From 0060517ae087eed94c64c175e5042b16e0a415fa Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 6 Nov 2014 14:02:57 +0100 Subject: 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 --- board/esd/pci405/cmd_pci405.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'board/esd') diff --git a/board/esd/pci405/cmd_pci405.c b/board/esd/pci405/cmd_pci405.c index 55c20d0..29c688a 100644 --- a/board/esd/pci405/cmd_pci405.c +++ b/board/esd/pci405/cmd_pci405.c @@ -23,7 +23,7 @@ */ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - unsigned int *ptr = 0; + unsigned int *ptr; int count = 0; int count2 = 0; int i; @@ -35,12 +35,14 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * Mark sync address */ ptr = 0; + /* cppcheck-suppress nullPointer */ *ptr = 0xffffffff; puts("\nWaiting for image from pci host -"); /* * Wait for host to write the start address */ + /* cppcheck-suppress nullPointer */ while (*ptr == 0xffffffff) { count++; if (!(count % 100)) { -- cgit v1.1