From 86373411a23051a18ae3ed01b180f838dbcd76e7 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 13 Jul 2013 16:09:05 +0200 Subject: misc: fix multiple NULL pointer sparse warnings Those are fixes for the following warnings: pcap_mm.c:119:29: warning: Using plain integer as NULL pointer pcap_mm.c:141:29: warning: Using plain integer as NULL pointer ring.c:24:31: warning: Using plain integer as NULL pointer flowtop.c:1114:22: warning: Using plain integer as NULL pointer ifpps.c:1133:29: warning: Using plain integer as NULL pointer Signed-off-by: Daniel Borkmann --- flowtop.c | 2 +- ifpps.c | 2 +- pcap_mm.c | 4 ++-- ring.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flowtop.c b/flowtop.c index b9d32cc..3e55079 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1111,7 +1111,7 @@ static void *collector(void *null) flow_list_destroy(&flow_list); nfct_close(handle); - pthread_exit(0); + pthread_exit(NULL); } int main(int argc, char **argv) diff --git a/ifpps.c b/ifpps.c index ea98ca2..6742dd7 100644 --- a/ifpps.c +++ b/ifpps.c @@ -1130,7 +1130,7 @@ static void term_csv(const char *ifname, const struct ifstat *rel, { int cpus, i; - printf("%ld ", time(0)); + printf("%ld ", time(NULL)); printf("%llu ", rel->rx_bytes); printf("%llu ", rel->rx_packets); diff --git a/pcap_mm.c b/pcap_mm.c index ea74034..952f872 100644 --- a/pcap_mm.c +++ b/pcap_mm.c @@ -116,7 +116,7 @@ static void __pcap_mm_prepare_access_wr(int fd, bool jumbo) if (ret != 1) panic("Cannot write file!\n"); - ptr_va_start = mmap(0, map_size, PROT_WRITE, MAP_SHARED, fd, 0); + ptr_va_start = mmap(NULL, map_size, PROT_WRITE, MAP_SHARED, fd, 0); if (ptr_va_start == MAP_FAILED) panic("mmap of file failed!"); ret = madvise(ptr_va_start, map_size, MADV_SEQUENTIAL); @@ -138,7 +138,7 @@ static void __pcap_mm_prepare_access_rd(int fd) panic("pcap dump file is not a regular file!\n"); map_size = sb.st_size; - ptr_va_start = mmap(0, map_size, PROT_READ, MAP_SHARED | MAP_LOCKED, fd, 0); + ptr_va_start = mmap(NULL, map_size, PROT_READ, MAP_SHARED | MAP_LOCKED, fd, 0); if (ptr_va_start == MAP_FAILED) panic("mmap of file failed!"); ret = madvise(ptr_va_start, map_size, MADV_SEQUENTIAL); diff --git a/ring.c b/ring.c index c5d2d99..a227957 100644 --- a/ring.c +++ b/ring.c @@ -21,7 +21,7 @@ void mmap_ring_generic(int sock, struct ring *ring) { - ring->mm_space = mmap(0, ring->mm_len, PROT_READ | PROT_WRITE, + ring->mm_space = mmap(NULL, ring->mm_len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED | MAP_POPULATE, sock, 0); if (ring->mm_space == MAP_FAILED) panic("Cannot mmap {TX,RX}_RING!\n"); -- cgit v1.2.3-54-g00ecf