"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

common: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

authored by

Marek Vasut and committed by
Tom Rini
910cef3d e569c73a

-135
-1
common/bootstage.c
··· 3 3 * Copyright (c) 2011, Google Inc. All rights reserved. 4 4 */ 5 5 6 - 7 6 /* 8 7 * This module records the progress of boot and arbitrary commands, and 9 8 * permits accurate timestamping of each.
-4
common/cli_hush.c
··· 732 732 return EXIT_SUCCESS; 733 733 } 734 734 735 - 736 735 /* built-in 'pwd' handler */ 737 736 static int builtin_pwd(struct child_prog *dummy) 738 737 { ··· 783 782 784 783 return EXIT_SUCCESS; 785 784 } 786 - 787 785 788 786 /* Built-in 'shift' handler */ 789 787 static int builtin_shift(struct child_prog *child) ··· 1731 1729 1732 1730 pseudo_exec(child); 1733 1731 } 1734 - 1735 1732 1736 1733 /* put our child in the process group whose leader is the 1737 1734 first process in this pipe */ ··· 3408 3405 } 3409 3406 3410 3407 last_return_code=EXIT_SUCCESS; 3411 - 3412 3408 3413 3409 if (argv[0] && argv[0][0] == '-') { 3414 3410 debug_printf("\nsourcing /etc/profile\n");
-26
common/cli_hush_upstream.c
··· 392 392 #define BASH_TEST2 (ENABLE_HUSH_BASH_COMPAT && ENABLE_HUSH_TEST) 393 393 #define BASH_READ_D ENABLE_HUSH_BASH_COMPAT 394 394 395 - 396 395 /* Build knobs */ 397 396 #define LEAK_HUNTING 0 398 397 #define BUILD_AS_NOMMU 0 ··· 412 411 * So far ${var%...} ops are always enabled: 413 412 */ 414 413 #define ENABLE_HUSH_DOLLAR_OPS 1 415 - 416 414 417 415 #if BUILD_AS_NOMMU 418 416 # undef BB_MMU ··· 518 516 char **argv_from_re_execing; 519 517 } nommu_save_t; 520 518 #endif 521 - 522 519 523 520 enum { 524 521 RES_NONE = 0, ··· 828 825 # endif 829 826 }; 830 827 #endif 831 - 832 828 833 829 /* set -/+o OPT support. (TODO: make it optional) 834 830 * bash supports the following opts: ··· 1118 1114 } while (0) 1119 1115 #endif /* !__U_BOOT__ */ 1120 1116 1121 - 1122 1117 #ifndef __U_BOOT__ 1123 1118 /* Function prototypes for builtins */ 1124 1119 static int builtin_cd(char **argv) FAST_FUNC; ··· 1416 1411 # define debug_print_strings(prefix, vv) ((void)0) 1417 1412 #endif 1418 1413 1419 - 1420 1414 /* Leak hunting. Use hush_leaktool.sh for post-processing. 1421 1415 */ 1422 1416 #if LEAK_HUNTING ··· 1448 1442 # define xstrdup(s) xxstrdup(__LINE__, s) 1449 1443 # define free(p) xxfree(p) 1450 1444 #endif 1451 - 1452 1445 1453 1446 /* Syntax and runtime errors. They always abort scripts. 1454 1447 * In interactive use they usually discard unparsed and/or unexecuted commands ··· 1689 1682 return newfd; 1690 1683 } 1691 1684 1692 - 1693 1685 /* Manipulating HFILEs */ 1694 1686 static HFILE *hfopen(const char *name) 1695 1687 { ··· 1881 1873 IF_HUSH_SET(G.global_args_malloced = sv->sv_g_malloced;) 1882 1874 } 1883 1875 #endif /* !__U_BOOT__ */ 1884 - 1885 1876 1886 1877 #ifndef __U_BOOT__ 1887 1878 /* Basic theory of signal handling in shell ··· 2330 2321 } 2331 2322 return last_sig; 2332 2323 } 2333 - 2334 2324 2335 2325 static const char *get_cwd(int force) 2336 2326 { ··· 2653 2643 } 2654 2644 #endif 2655 2645 2656 - 2657 2646 #ifndef __U_BOOT__ 2658 2647 /* 2659 2648 * Helpers for "var1=val1 var2=val2 cmd" feature ··· 2727 2716 } 2728 2717 free(strings); 2729 2718 } 2730 - 2731 2719 2732 2720 /* 2733 2721 * Unicode helper ··· 3235 3223 /*i->file = NULL */; 3236 3224 i->p = s; 3237 3225 } 3238 - 3239 3226 3240 3227 /* 3241 3228 * o_string support ··· 3997 3984 } 3998 3985 } 3999 3986 4000 - 4001 3987 /*** Parsing routines ***/ 4002 3988 4003 3989 #ifndef debug_print_tree ··· 4648 4634 return 0; 4649 4635 } 4650 4636 4651 - 4652 4637 #ifndef __U_BOOT__ 4653 4638 /* Peek ahead in the input to find out if we have a "&n" construct, 4654 4639 * as in "2>&1", that represents duplicating a file descriptor. ··· 4958 4943 return heredoc_cnt; 4959 4944 } 4960 4945 4961 - 4962 4946 static int run_list(struct pipe *pi); 4963 4947 #if BB_MMU 4964 4948 #define parse_stream(pstring, heredoc_cnt_ptr, input, end_trigger) \ ··· 5174 5158 //if (ch == '$') ... 5175 5159 } 5176 5160 } 5177 - 5178 5161 5179 5162 /* Process `cmd` - copy contents until "`" is seen. Complicated by 5180 5163 * \` quoting. ··· 6477 6460 } 6478 6461 } 6479 6462 6480 - 6481 6463 /*** Execution routines ***/ 6482 6464 6483 6465 /* Expansion can recurse, need forward decls: */ ··· 7778 7760 return p; 7779 7761 } 7780 7762 7781 - 7782 7763 static void switch_off_special_sigs(unsigned mask) 7783 7764 { 7784 7765 unsigned sig = 0; ··· 8296 8277 return WEXITSTATUS(status); 8297 8278 } 8298 8279 #endif /* ENABLE_HUSH_TICK */ 8299 - 8300 8280 8301 8281 static void setup_heredoc(struct redir_struct *redir) 8302 8282 { ··· 9006 8986 } 9007 8987 #endif /* ENABLE_HUSH_FUNCTIONS */ 9008 8988 9009 - 9010 8989 #ifndef __U_BOOT__ 9011 8990 #if BB_MMU 9012 8991 #define exec_builtin(to_free, x, argv) \ ··· 9041 9020 #endif 9042 9021 } 9043 9022 #endif /* !__U_BOOT__ */ 9044 - 9045 9023 9046 9024 #ifndef __U_BOOT__ 9047 9025 static void execvp_or_die(char **argv) NORETURN; ··· 10838 10816 debug_printf_exec("run_and_free_list return %d\n", rcode); 10839 10817 return rcode; 10840 10818 } 10841 - 10842 10819 10843 10820 #ifndef __U_BOOT__ 10844 10821 static void install_sighandlers(unsigned mask) ··· 11524 11501 hush_exit(G.last_exitcode); 11525 11502 } 11526 11503 11527 - 11528 - 11529 11504 /* 11530 11505 * Built-ins 11531 11506 */ ··· 13003 12978 p = malloc(3400); 13004 12979 if (l < (unsigned long)p) l = (unsigned long)p; 13005 12980 free(p); 13006 - 13007 12981 13008 12982 # if 0 /* debug */ 13009 12983 {
-84
common/dlmalloc.c
··· 53 53 Thanks to Martin Fong and others for supplying this. 54 54 */ 55 55 56 - 57 56 #ifdef WIN32 58 57 59 58 #define AlignPage(add) (((add) + (malloc_getpagesize-1)) & \ ··· 155 154 156 155 } 157 156 158 - 159 157 void* wsbrk (long size) 160 158 { 161 159 void* tmp; ··· 236 234 237 235 #endif 238 236 239 - 240 - 241 237 /* 242 238 Type declarations 243 239 */ 244 - 245 240 246 241 struct malloc_chunk 247 242 { ··· 269 264 in use. 270 265 271 266 An allocated chunk looks like this: 272 - 273 267 274 268 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 275 269 | Size of previous chunk, if allocated | | ··· 284 278 | Size of chunk | 285 279 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 286 280 287 - 288 281 Where "chunk" is the front of the chunk for the purpose of most of 289 282 the malloc code, but "mem" is the pointer that is returned to the 290 283 user. "Nextchunk" is the beginning of the next contiguous chunk. ··· 401 394 402 395 #define aligned_OK(m) (((unsigned long)((m)) & (MALLOC_ALIGN_MASK)) == 0) 403 396 404 - 405 - 406 - 407 397 /* 408 398 Physical chunk operations 409 399 */ 410 - 411 400 412 401 /* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */ 413 402 ··· 421 410 422 411 #define SIZE_BITS (PREV_INUSE|IS_MMAPPED) 423 412 424 - 425 413 /* Ptr to next physical malloc_chunk. */ 426 414 427 415 #define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & ~PREV_INUSE) )) ··· 431 419 #define prev_chunk(p)\ 432 420 ((mchunkptr)( ((char*)(p)) - ((p)->prev_size) )) 433 421 434 - 435 422 /* Treat space at ptr + offset as a chunk */ 436 423 437 424 #define chunk_at_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) 438 - 439 - 440 - 441 425 442 426 /* 443 427 Dealing with use bits ··· 475 459 #define clear_inuse_bit_at_offset(p, s)\ 476 460 (((mchunkptr)(((char*)(p)) + (s)))->size &= ~(PREV_INUSE)) 477 461 478 - 479 - 480 - 481 462 /* 482 463 Dealing with size fields 483 464 */ ··· 498 479 499 480 #define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_size = (s)) 500 481 501 - 502 - 503 - 504 - 505 482 /* 506 483 Bins 507 484 ··· 554 531 555 532 #define top (av_[2]) /* The topmost chunk */ 556 533 #define last_remainder (bin_at(1)) /* remainder from last split */ 557 - 558 534 559 535 /* 560 536 Because top initially points to its own bin with initial ··· 671 647 672 648 #define is_small_request(nb) (nb < MAX_SMALLBIN_SIZE - SMALLBIN_WIDTH) 673 649 674 - 675 - 676 650 /* 677 651 To help compensate for the large number of bins, a one-level index 678 652 structure is used for bin-by-bin searching. `binblocks' is a ··· 694 668 #define mark_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r | idx2binblock(ii))) 695 669 #define clear_binblock(ii) (binblocks_w = (mbinptr)(binblocks_r & ~(idx2binblock(ii)))) 696 670 697 - 698 - 699 - 700 - 701 671 /* Other static bookkeeping data */ 702 672 703 673 /* variables holding tunable values */ ··· 770 740 771 741 #ifdef DEBUG 772 742 773 - 774 743 /* 775 744 These routines make a number of assertions about the states 776 745 of data structures that should be true at all times. If any ··· 798 767 assert((char*)p + sz <= sbrk_base + sbrked_mem); 799 768 800 769 } 801 - 802 770 803 771 #if __STD_C 804 772 static void do_check_free_chunk(mchunkptr p) ··· 885 853 /* ... and alignment */ 886 854 assert(aligned_OK(chunk2mem(p))); 887 855 888 - 889 856 /* ... and was allocated at front of an available chunk */ 890 857 assert(prev_inuse(p)); 891 858 892 859 } 893 - 894 860 895 861 #define check_free_chunk(P) do_check_free_chunk(P) 896 862 #define check_inuse_chunk(P) do_check_inuse_chunk(P) ··· 903 869 #define check_malloced_chunk(P,N) 904 870 #endif 905 871 906 - 907 - 908 872 /* 909 873 Macro-based internal utilities 910 874 */ 911 - 912 875 913 876 /* 914 877 Linking chunks in bin lists. ··· 920 883 putting it ahead of others of same size. 921 884 */ 922 885 923 - 924 886 #define frontlink(P, S, IDX, BK, FD) \ 925 887 { \ 926 888 if (S < MAX_SMALLBIN_SIZE) \ ··· 950 912 } \ 951 913 } 952 914 953 - 954 915 /* take a chunk off a list */ 955 916 956 917 #define unlink(P, BK, FD) \ ··· 974 935 #define clear_last_remainder \ 975 936 (last_remainder->fd = last_remainder->bk = last_remainder) 976 937 977 - 978 - 979 - 980 - 981 938 /* Routines dealing with mmap(). */ 982 939 983 940 #if HAVE_MMAP ··· 1219 1176 assert(((unsigned long)((char*)top + top_size) & (pagesz - 1)) == 0); 1220 1177 } 1221 1178 1222 - 1223 - 1224 - 1225 1179 /* Main public routines */ 1226 - 1227 1180 1228 1181 /* 1229 1182 Malloc Algorthim: ··· 1274 1227 sbrk calls to be consolidated, but does not require 1275 1228 contiguous memory. Thus, it should be safe to intersperse 1276 1229 mallocs with other sbrk calls. 1277 - 1278 1230 1279 1231 All allocations are made from the the `lowest' part of any found 1280 1232 chunk. (The implementation invariant is that prev_inuse is ··· 1514 1466 } 1515 1467 } 1516 1468 1517 - 1518 1469 /* Try to use top chunk */ 1519 1470 1520 1471 /* Require that there be a remainder, ensuring top always exists */ ··· 1545 1496 1546 1497 } 1547 1498 1548 - 1549 - 1550 - 1551 1499 /* 1552 1500 1553 1501 free() algorithm : ··· 1568 1516 consolidating with the current `last_remainder'). 1569 1517 1570 1518 */ 1571 - 1572 1519 1573 1520 STATIC_IF_MCHECK 1574 1521 #if __STD_C ··· 1665 1612 unlink(next, bck, fwd); 1666 1613 } 1667 1614 1668 - 1669 1615 set_head(p, sz | PREV_INUSE); 1670 1616 set_foot(p, sz); 1671 1617 if (!islr) 1672 1618 frontlink(p, sz, idx, bck, fwd); 1673 1619 } 1674 - 1675 - 1676 - 1677 - 1678 1620 1679 1621 /* 1680 1622 ··· 1708 1650 and allowing it would also allow too many other incorrect 1709 1651 usages of realloc to be sensible. 1710 1652 1711 - 1712 1653 */ 1713 - 1714 1654 1715 1655 STATIC_IF_MCHECK 1716 1656 #if __STD_C ··· 1761 1701 1762 1702 newp = oldp = mem2chunk(oldmem); 1763 1703 newsize = oldsize = chunksize(oldp); 1764 - 1765 1704 1766 1705 nb = request2size(bytes); 1767 1706 ··· 1910 1849 VALGRIND_MAKE_MEM_DEFINED(oldmem, bytes); 1911 1850 } 1912 1851 1913 - 1914 1852 split: /* split off extra room in old or expanded chunk */ 1915 1853 1916 1854 if (newsize - nb >= MINSIZE) /* split off remainder */ ··· 1934 1872 return chunk2mem(newp); 1935 1873 } 1936 1874 1937 - 1938 - 1939 - 1940 1875 /* 1941 1876 1942 1877 memalign algorithm: ··· 1954 1889 Overreliance on memalign is a sure way to fragment space. 1955 1890 1956 1891 */ 1957 - 1958 1892 1959 1893 STATIC_IF_MCHECK 1960 1894 #if __STD_C ··· 2103 2037 return chunk2mem(p); 2104 2038 2105 2039 } 2106 - 2107 - 2108 - 2109 2040 2110 2041 /* 2111 2042 valloc just invokes memalign with alignment argument equal ··· 2127 2058 that will accommodate request 2128 2059 */ 2129 2060 2130 - 2131 2061 #if __STD_C 2132 2062 Void_t* pvALLOc(size_t bytes) 2133 2063 #else ··· 2156 2086 2157 2087 INTERNAL_SIZE_T sz = n * elem_size; 2158 2088 2159 - 2160 2089 /* check if expand_top called, in which case don't need to clear */ 2161 2090 #if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) 2162 2091 #if MORECORE_CLEARS ··· 2181 2110 p = mem2chunk(mem); 2182 2111 2183 2112 /* Two optional cases in which clearing not necessary */ 2184 - 2185 2113 2186 2114 #if HAVE_MMAP 2187 2115 if (chunk_is_mmapped(p)) return mem; ··· 2223 2151 } 2224 2152 #endif 2225 2153 2226 - 2227 2154 #ifdef MCHECK_HEAP_PROTECTION 2228 2155 #include "mcheck_core.inc.h" 2229 2156 #if !__STD_C ··· 2307 2234 enum mcheck_status mprobe(void *__ptr) { return mcheck_mprobe(__ptr); } 2308 2235 // mcheck API } 2309 2236 #endif 2310 - 2311 2237 2312 2238 /* 2313 2239 ··· 2388 2314 } 2389 2315 } 2390 2316 2391 - 2392 - 2393 2317 /* 2394 2318 malloc_usable_size: 2395 2319 ··· 2422 2346 return chunksize(p) - 2*SIZE_SZ; 2423 2347 } 2424 2348 } 2425 - 2426 - 2427 - 2428 2349 2429 2350 /* Utility to update current_mallinfo for malloc_stats and mallinfo() */ 2430 2351 ··· 2468 2389 } 2469 2390 #endif /* DEBUG */ 2470 2391 2471 - 2472 - 2473 2392 /* 2474 2393 2475 2394 malloc_stats: ··· 2513 2432 return current_mallinfo; 2514 2433 } 2515 2434 #endif /* DEBUG */ 2516 - 2517 - 2518 - 2519 2435 2520 2436 /* 2521 2437 mallopt:
-1
common/edid.c
··· 268 268 panel_bits_per_colourp, NULL, NULL); 269 269 } 270 270 271 - 272 271 /** 273 272 * Snip the tailing whitespace/return of a string. 274 273 *
-1
common/kallsyms.c
··· 5 5 * Licensed under the GPL-2 or later. 6 6 */ 7 7 8 - 9 8 /* We need the weak marking as this symbol is provided specially */ 10 9 extern const char system_map[] __attribute__((weak)); 11 10
-1
common/kgdb.c
··· 446 446 } 447 447 break; 448 448 449 - 450 449 case 'k': /* kill the program, actually return to monitor */ 451 450 kd.extype = KGDBEXIT_KILL; 452 451 *regs = entry_regs;
-1
common/menu.c
··· 398 398 } else 399 399 m->title = NULL; 400 400 401 - 402 401 INIT_LIST_HEAD(&m->items); 403 402 404 403 return m;
-1
common/update.c
··· 254 254 else 255 255 addr = CONFIG_UPDATE_LOAD_ADDR; 256 256 257 - 258 257 if (update_load(filename, CONFIG_UPDATE_TFTP_MSEC_MAX, 259 258 CONFIG_UPDATE_TFTP_CNT_MAX, addr)) { 260 259 printf("Can't load update file, aborting auto-update\n");
-8
common/usb.c
··· 190 190 } 191 191 #endif /* !CONFIG_IS_ENABLED(DM_USB) */ 192 192 193 - 194 193 /*------------------------------------------------------------------- 195 194 * Message wrappers. 196 195 * ··· 292 291 else 293 292 return -EIO; 294 293 } 295 - 296 294 297 295 /*------------------------------------------------------------------- 298 296 * Max Packet stuff ··· 559 557 return 0; 560 558 } 561 559 562 - 563 560 /********************************************************************** 564 561 * get_descriptor type 565 562 */ ··· 767 764 768 765 return result; 769 766 } 770 - 771 767 772 768 static void usb_try_string_workarounds(unsigned char *buf, int *length) 773 769 { ··· 783 779 } 784 780 } 785 781 786 - 787 782 static int usb_string_sub(struct usb_device *dev, unsigned int langid, 788 783 unsigned int index, unsigned char *buf) 789 784 { ··· 817 812 818 813 return rc; 819 814 } 820 - 821 815 822 816 /******************************************************************** 823 817 * usb_string: ··· 873 867 err = idx; 874 868 return err; 875 869 } 876 - 877 870 878 871 /******************************************************************** 879 872 * USB device handling: ··· 1387 1380 *hub_port = 0; 1388 1381 } 1389 1382 #endif 1390 - 1391 1383 1392 1384 /* EOF */
-1
common/usb_hub.c
··· 162 162 return ret; 163 163 } 164 164 165 - 166 165 static void usb_hub_power_on(struct usb_hub_device *hub) 167 166 { 168 167 int i;
-4
common/usb_storage.c
··· 31 31 * only been tested with USB memory sticks. 32 32 */ 33 33 34 - 35 34 #include <blk.h> 36 35 #include <bootdev.h> 37 36 #include <command.h> ··· 351 350 us->ip_wanted = 0; 352 351 return 0; 353 352 } 354 - 355 353 356 354 #ifdef DEBUG 357 355 ··· 664 662 return result; 665 663 } 666 664 667 - 668 665 static int usb_stor_CBI_get_status(struct scsi_cmd *srb, struct us_data *us) 669 666 { 670 667 int timeout; ··· 1115 1112 debug("write10: start %lx blocks %x\n", start, blocks); 1116 1113 return ss->transport(srb, ss); 1117 1114 } 1118 - 1119 1115 1120 1116 #ifdef CONFIG_USB_BIN_FIXUP 1121 1117 /*
-2
common/xyzModem.c
··· 62 62 #define xyzModem_MAX_RETRIES_WITH_CRC 10 63 63 #define xyzModem_CAN_COUNT 3 /* Wait for 3 CAN before quitting */ 64 64 65 - 66 65 typedef int cyg_int32; 67 66 static int 68 67 CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c) ··· 176 175 } 177 176 return true; 178 177 } 179 - 180 178 181 179 #if defined(DEBUG) && !CONFIG_IS_ENABLED(USE_TINY_PRINTF) 182 180 /*