diff options
author | pfg <pfg@FreeBSD.org> | 2017-03-14 02:06:03 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-03-14 02:06:03 +0000 |
commit | f3584df197214b997bc9ae927780e03c37c9e36c (patch) | |
tree | aae668303806e238ca59fc767e74a67964266c3f /sys/boot | |
parent | 1c6f535240ae8fa78eae79343be21fe7ff7a6807 (diff) | |
download | FreeBSD-src-f3584df197214b997bc9ae927780e03c37c9e36c.zip FreeBSD-src-f3584df197214b997bc9ae927780e03c37c9e36c.tar.gz |
MFC r313982, r314068:
sys: Replace zero with NULL for pointers.
Found with: devel/coccinelle
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/common/md.c | 2 | ||||
-rw-r--r-- | sys/boot/efi/libefi/efinet.c | 4 | ||||
-rw-r--r-- | sys/boot/fdt/fdt_overlay.c | 2 | ||||
-rw-r--r-- | sys/boot/ficl/ficl.c | 2 | ||||
-rw-r--r-- | sys/boot/kshim/bsd_kernel.c | 2 | ||||
-rw-r--r-- | sys/boot/ofw/libofw/ofw_memory.c | 2 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/main.c | 2 | ||||
-rw-r--r-- | sys/boot/userboot/userboot/userboot_disk.c | 4 | ||||
-rw-r--r-- | sys/boot/zfs/zfs.c | 2 | ||||
-rw-r--r-- | sys/boot/zfs/zfsimpl.c | 6 |
10 files changed, 14 insertions, 14 deletions
diff --git a/sys/boot/common/md.c b/sys/boot/common/md.c index 2554b04..12a6670 100644 --- a/sys/boot/common/md.c +++ b/sys/boot/common/md.c @@ -103,7 +103,7 @@ md_strategy(void *devdata, int rw, daddr_t blk, size_t size, if ((ofs + size) > MD_IMAGE_SIZE) size = MD_IMAGE_SIZE - ofs; - if (rsize != 0) + if (rsize != NULL) *rsize = size; switch (rw) { diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c index 56f9510..d845826 100644 --- a/sys/boot/efi/libefi/efinet.c +++ b/sys/boot/efi/libefi/efinet.c @@ -131,13 +131,13 @@ efinet_put(struct iodesc *desc, void *pkt, size_t len) /* Wait for the buffer to be transmitted */ do { - buf = 0; /* XXX Is this needed? */ + buf = NULL; /* XXX Is this needed? */ status = net->GetStatus(net, 0, &buf); /* * XXX EFI1.1 and the E1000 card returns a different * address than we gave. Sigh. */ - } while (status == EFI_SUCCESS && buf == 0); + } while (status == EFI_SUCCESS && buf == NULL); /* XXX How do we deal with status != EFI_SUCCESS now? */ return ((status == EFI_SUCCESS) ? len : -1); diff --git a/sys/boot/fdt/fdt_overlay.c b/sys/boot/fdt/fdt_overlay.c index a19f06e..0d9b367 100644 --- a/sys/boot/fdt/fdt_overlay.c +++ b/sys/boot/fdt/fdt_overlay.c @@ -64,7 +64,7 @@ fdt_get_fixup_location(void *fdtp, const char *fixup) int prop_offset, o, proplen; void *result; - result = 0; + result = NULL; path = strdup(fixup); prop = strchr(path, ':'); diff --git a/sys/boot/ficl/ficl.c b/sys/boot/ficl/ficl.c index d4370eb..219cf84 100644 --- a/sys/boot/ficl/ficl.c +++ b/sys/boot/ficl/ficl.c @@ -276,7 +276,7 @@ void ficlFreeVM(FICL_VM *pVM) FICL_SYSTEM *pSys = pVM->pSys; FICL_VM *pList = pSys->vmList; - assert(pVM != 0); + assert(pVM != NULL); if (pSys->vmList == pVM) { diff --git a/sys/boot/kshim/bsd_kernel.c b/sys/boot/kshim/bsd_kernel.c index c94b755..75eccb1 100644 --- a/sys/boot/kshim/bsd_kernel.c +++ b/sys/boot/kshim/bsd_kernel.c @@ -75,7 +75,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, void *addr; addr = malloc(dmat->maxsize + dmat->alignment, XXX, XXX); - if (addr == 0) + if (addr == NULL) return (ENOMEM); *mapp = addr; diff --git a/sys/boot/ofw/libofw/ofw_memory.c b/sys/boot/ofw/libofw/ofw_memory.c index 60cc904..5616184 100644 --- a/sys/boot/ofw/libofw/ofw_memory.c +++ b/sys/boot/ofw/libofw/ofw_memory.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "openfirm.h" -static void *heap_base = 0; +static void *heap_base = NULL; static unsigned int heap_size = 0; struct ofw_mapping { diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c index d7b4e1e..e70d9bb 100644 --- a/sys/boot/sparc64/loader/main.c +++ b/sys/boot/sparc64/loader/main.c @@ -859,7 +859,7 @@ main(int (*openfirm)(void *)) /* * Initialize devices. */ - for (dp = devsw; *dp != 0; dp++) + for (dp = devsw; *dp != NULL; dp++) if ((*dp)->dv_init != 0) (*dp)->dv_init(); diff --git a/sys/boot/userboot/userboot/userboot_disk.c b/sys/boot/userboot/userboot/userboot_disk.c index ce7dee5..b39101b 100644 --- a/sys/boot/userboot/userboot/userboot_disk.c +++ b/sys/boot/userboot/userboot/userboot_disk.c @@ -91,8 +91,8 @@ userdisk_init(void) return (ENOMEM); for (i = 0; i < userdisk_maxunit; i++) { if (CALLBACK(diskioctl, i, DIOCGSECTORSIZE, - §orsize) != 0 || CALLBACK(diskioctl, i, - DIOCGMEDIASIZE, &mediasize) != 0) + §orsize) != NULL || CALLBACK(diskioctl, i, + DIOCGMEDIASIZE, &mediasize) != NULL) return (ENXIO); ud_info[i].mediasize = mediasize; ud_info[i].sectorsize = sectorsize; diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index 466d18f..1ead135c 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -126,7 +126,7 @@ zfs_close(struct open_file *f) { struct file *fp = (struct file *)f->f_fsdata; - dnode_cache_obj = 0; + dnode_cache_obj = NULL; f->f_fsdata = (void *)0; if (fp == (struct file *)0) return (0); diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index aa1a789..4c45924 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -67,7 +67,7 @@ static const char *features_for_read[] = { static spa_list_t zfs_pools; static uint64_t zfs_crc64_table[256]; -static const dnode_phys_t *dnode_cache_obj = 0; +static const dnode_phys_t *dnode_cache_obj = NULL; static uint64_t dnode_cache_bn; static char *dnode_cache_buf; static char *zap_scratch; @@ -1430,7 +1430,7 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint6 zc = &ZAP_LEAF_CHUNK(&zl, h); while (zc->l_entry.le_hash != hash) { if (zc->l_entry.le_next == 0xffff) { - zc = 0; + zc = NULL; break; } zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); @@ -2127,7 +2127,7 @@ zfs_lookup(const struct zfsmount *mount, const char *upath, dnode_phys_t *dnode) p = q; } else { strcpy(element, p); - p = 0; + p = NULL; } rc = zfs_dnode_stat(spa, &dn, &sb); |