Commit 0060517ae087eed94c64c175e5042b16e0a415fa
Committed by
Tom Rini
1 parent
adbba99606
Exists in
v2017.01-smarct4x
and in
37 other branches
cppcheck cleanup: fix nullPointer errors
There are a number of places where U-Boot intentionally and legally accesses physical address 0x0000, for example when installing exception vectors on systems where these are located in low memory. Add "cppcheck-suppress nullPointer" comments to silence cppcheck where this is intentional and legal. Signed-off-by: Wolfgang Denk <wd@denx.de>
Showing 9 changed files with 17 additions and 2 deletions Side-by-side Diff
arch/arm/cpu/arm926ejs/mxs/mxs.c
arch/arm/cpu/arm926ejs/mxs/spl_boot.c
arch/arm/cpu/armv7/zynq/ddrc.c
arch/blackfin/cpu/initcode.c
arch/powerpc/cpu/mpc85xx/cpu_init_early.c
... | ... | @@ -161,9 +161,12 @@ |
161 | 161 | setup_ifc_sram = (void *)SRAM_BASE_ADDR; |
162 | 162 | dst = (u32 *) SRAM_BASE_ADDR; |
163 | 163 | src = (u32 *) setup_ifc; |
164 | - for (i = 0; i < 1024; i++) | |
164 | + for (i = 0; i < 1024; i++) { | |
165 | + /* cppcheck-suppress nullPointer */ | |
165 | 166 | *dst++ = *src++; |
167 | + } | |
166 | 168 | |
169 | + /* cppcheck-suppress nullPointer */ | |
167 | 170 | setup_ifc_sram(); |
168 | 171 | |
169 | 172 | /* CLEANUP */ |
arch/sh/lib/zimageboot.c
board/esd/pci405/cmd_pci405.c
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | */ |
24 | 24 | int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
25 | 25 | { |
26 | - unsigned int *ptr = 0; | |
26 | + unsigned int *ptr; | |
27 | 27 | int count = 0; |
28 | 28 | int count2 = 0; |
29 | 29 | int i; |
30 | 30 | |
... | ... | @@ -35,12 +35,14 @@ |
35 | 35 | * Mark sync address |
36 | 36 | */ |
37 | 37 | ptr = 0; |
38 | + /* cppcheck-suppress nullPointer */ | |
38 | 39 | *ptr = 0xffffffff; |
39 | 40 | puts("\nWaiting for image from pci host -"); |
40 | 41 | |
41 | 42 | /* |
42 | 43 | * Wait for host to write the start address |
43 | 44 | */ |
45 | + /* cppcheck-suppress nullPointer */ | |
44 | 46 | while (*ptr == 0xffffffff) { |
45 | 47 | count++; |
46 | 48 | if (!(count % 100)) { |
board/keymile/common/common.c
... | ... | @@ -360,6 +360,7 @@ |
360 | 360 | testboot = (testpin != 0) && (s); |
361 | 361 | if (verbose) { |
362 | 362 | printf("testpin = %d\n", testpin); |
363 | + /* cppcheck-suppress nullPointer */ | |
363 | 364 | printf("test_bank = %s\n", s ? s : "not set"); |
364 | 365 | printf("boot test app : %s\n", (testboot) ? "yes" : "no"); |
365 | 366 | } |
board/scb9328/flash.c