summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2011-01-24 19:15:51 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-01-24 19:15:51 +0000
commit73f8ec8b1e623681c8d6f3a9df142da2a8bed7e3 (patch)
tree4736c1577d6fcb12ce297b723b9a95a1310a1fd8
parentff30d8a5383553d4df035cdcf0e24a0b44d4241a (diff)
downloadast2050-flashrom-73f8ec8b1e623681c8d6f3a9df142da2a8bed7e3.zip
ast2050-flashrom-73f8ec8b1e623681c8d6f3a9df142da2a8bed7e3.tar.gz
Fix sparse warning: Using plain integer as NULL pointer
This patch fixes the "using plain integer as NULL pointer" warnings generated by running sparse on the flashrom source. Corresponding to flashrom svn r1255. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Stefan Reinauer <stepan@coreboot.org>
-rw-r--r--cbtable.c2
-rw-r--r--chipset_enable.c2
-rw-r--r--cli_classic.c34
-rw-r--r--physmap.c4
-rw-r--r--programmer.c2
-rw-r--r--serprog.c2
-rw-r--r--udelay.c8
7 files changed, 27 insertions, 27 deletions
diff --git a/cbtable.c b/cbtable.c
index dbb2cff..f30a3ae 100644
--- a/cbtable.c
+++ b/cbtable.c
@@ -141,7 +141,7 @@ static struct lb_header *find_lb_table(void *base, unsigned long start,
};
- return 0;
+ return NULL;
}
static void find_mainboard(struct lb_record *ptr, unsigned long addr)
diff --git a/chipset_enable.c b/chipset_enable.c
index 6d6008e..0896bce 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -1173,7 +1173,7 @@ const struct penable chipset_enables[] = {
int chipset_flash_enable(void)
{
- struct pci_dev *dev = 0;
+ struct pci_dev *dev = NULL;
int ret = -2; /* Nothing! */
int i;
diff --git a/cli_classic.c b/cli_classic.c
index 1211989..88b70db 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -116,23 +116,23 @@ int cli_classic(int argc, char *argv[])
static const char optstring[] = "r:Rw:v:nVEfc:m:l:i:p:Lzh";
static const struct option long_options[] = {
- {"read", 1, 0, 'r'},
- {"write", 1, 0, 'w'},
- {"erase", 0, 0, 'E'},
- {"verify", 1, 0, 'v'},
- {"noverify", 0, 0, 'n'},
- {"chip", 1, 0, 'c'},
- {"mainboard", 1, 0, 'm'},
- {"verbose", 0, 0, 'V'},
- {"force", 0, 0, 'f'},
- {"layout", 1, 0, 'l'},
- {"image", 1, 0, 'i'},
- {"list-supported", 0, 0, 'L'},
- {"list-supported-wiki", 0, 0, 'z'},
- {"programmer", 1, 0, 'p'},
- {"help", 0, 0, 'h'},
- {"version", 0, 0, 'R'},
- {0, 0, 0, 0}
+ {"read", 1, NULL, 'r'},
+ {"write", 1, NULL, 'w'},
+ {"erase", 0, NULL, 'E'},
+ {"verify", 1, NULL, 'v'},
+ {"noverify", 0, NULL, 'n'},
+ {"chip", 1, NULL, 'c'},
+ {"mainboard", 1, NULL, 'm'},
+ {"verbose", 0, NULL, 'V'},
+ {"force", 0, NULL, 'f'},
+ {"layout", 1, NULL, 'l'},
+ {"image", 1, NULL, 'i'},
+ {"list-supported", 0, NULL, 'L'},
+ {"list-supported-wiki", 0, NULL, 'z'},
+ {"programmer", 1, NULL, 'p'},
+ {"help", 0, NULL, 'h'},
+ {"version", 0, NULL, 'R'},
+ {NULL, 0, NULL, 0}
};
char *filename = NULL;
diff --git a/physmap.c b/physmap.c
index 4641e8e..70156a6 100644
--- a/physmap.c
+++ b/physmap.c
@@ -180,7 +180,7 @@ static void *sys_physmap_rw_uncached(unsigned long phys_addr, size_t len)
}
}
- virt_addr = mmap(0, len, PROT_WRITE | PROT_READ, MAP_SHARED,
+ virt_addr = mmap(NULL, len, PROT_WRITE | PROT_READ, MAP_SHARED,
fd_mem, (off_t)phys_addr);
return MAP_FAILED == virt_addr ? ERROR_PTR : virt_addr;
}
@@ -200,7 +200,7 @@ static void *sys_physmap_ro_cached(unsigned long phys_addr, size_t len)
}
}
- virt_addr = mmap(0, len, PROT_READ, MAP_SHARED,
+ virt_addr = mmap(NULL, len, PROT_READ, MAP_SHARED,
fd_mem_cached, (off_t)phys_addr);
return MAP_FAILED == virt_addr ? ERROR_PTR : virt_addr;
}
diff --git a/programmer.c b/programmer.c
index 0160867..5c1f963 100644
--- a/programmer.c
+++ b/programmer.c
@@ -30,7 +30,7 @@ int noop_shutdown(void)
void *fallback_map(const char *descr, unsigned long phys_addr, size_t len)
{
/* FIXME: Should return phys_addr. */
- return 0;
+ return NULL;
}
/* No-op/fallback unmap() for programmers which don't need special handling */
diff --git a/serprog.c b/serprog.c
index 2cdfea6..f869b07 100644
--- a/serprog.c
+++ b/serprog.c
@@ -541,7 +541,7 @@ static void sp_execute_opbuf_noflush(void)
{
if ((sp_max_write_n) && (sp_write_n_bytes))
sp_pass_writen();
- sp_stream_buffer_op(S_CMD_O_EXEC, 0, 0);
+ sp_stream_buffer_op(S_CMD_O_EXEC, 0, NULL);
msg_pspew(MSGHEADER "Executed operation buffer of %d bytes\n",
sp_opbuf_usage);
sp_opbuf_usage = 0;
diff --git a/udelay.c b/udelay.c
index 153f510..feae827 100644
--- a/udelay.c
+++ b/udelay.c
@@ -45,11 +45,11 @@ static unsigned long measure_os_delay_resolution(void)
struct timeval start, end;
unsigned long counter = 0;
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
timeusec = 0;
while (!timeusec && (++counter < 1000000000)) {
- gettimeofday(&end, 0);
+ gettimeofday(&end, NULL);
timeusec = 1000000 * (end.tv_sec - start.tv_sec) +
(end.tv_usec - start.tv_usec);
/* Protect against time going forward too much. */
@@ -68,9 +68,9 @@ static unsigned long measure_delay(int usecs)
unsigned long timeusec;
struct timeval start, end;
- gettimeofday(&start, 0);
+ gettimeofday(&start, NULL);
myusec_delay(usecs);
- gettimeofday(&end, 0);
+ gettimeofday(&end, NULL);
timeusec = 1000000 * (end.tv_sec - start.tv_sec) +
(end.tv_usec - start.tv_usec);
/* Protect against time going forward too much. */
OpenPOWER on IntegriCloud