From 4090d6ffa1823785f8178b599c8d75711c617a39 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Tue, 3 Jan 2012 22:22:30 +0100 Subject: [PATCH] kernel: Use NULL for pointers. --- sys/boot/efi/libefi/efinet.c | 5 +- sys/boot/efi/loader/main.c | 5 +- sys/boot/pc32/libi386/biossmap.c | 3 +- sys/bus/cam/cam_extend.c | 3 +- sys/bus/cam/scsi/scsi_da.c | 2 +- sys/bus/iicbus/pcf/pcf.c | 8 +-- sys/bus/isa/i386/isa_compat.c | 19 +++---- sys/bus/isa/pnp.c | 10 ++-- sys/bus/pccard/pccard.c | 6 +- sys/bus/ppbus/ppbconf.c | 2 +- sys/bus/usb/uhci.c | 4 +- sys/bus/usb/usb.c | 2 +- sys/bus/usb/usb_subr.c | 2 +- sys/cpu/i386/misc/db_disasm.c | 12 ++-- sys/cpu/x86_64/misc/db_disasm.c | 12 ++-- sys/ddb/db_aout.c | 7 +-- sys/ddb/db_command.c | 12 ++-- sys/ddb/db_sym.c | 9 ++- sys/dev/agp/agp.c | 2 +- sys/dev/atm/hfa/fore_buffer.c | 5 +- sys/dev/disk/aic/aic_isa.c | 4 +- sys/dev/disk/aic/aic_pccard.c | 4 +- sys/dev/disk/ata/atapi-cd.c | 3 +- sys/dev/disk/buslogic/bt_isa.c | 4 +- sys/dev/disk/buslogic/bt_pci.c | 4 +- sys/dev/disk/isp/isp_pci.c | 16 +++--- sys/dev/disk/md/md.c | 8 +-- sys/dev/disk/mps/mps_sas.c | 2 +- sys/dev/disk/mpt/mpt_raid.c | 2 +- sys/dev/disk/nata/atapi-cd.c | 3 +- sys/dev/disk/ncr/ncr.c | 4 +- sys/dev/disk/sym/sym_hipd.c | 56 +++++++++---------- sys/dev/misc/nmdm/nmdm.c | 2 +- sys/dev/misc/ppc/ppc.c | 6 +- sys/dev/misc/pps/pps.c | 2 +- sys/dev/misc/puc/puc.c | 2 +- sys/dev/netif/de/if_de.c | 2 +- sys/dev/netif/ed/if_ed.c | 4 +- sys/dev/netif/ep/if_ep.c | 5 +- sys/dev/netif/fe/if_fe.c | 5 +- sys/dev/netif/ic/if_ic.c | 2 +- sys/dev/netif/mn/if_mn.c | 16 +++--- sys/dev/netif/plip/if_plip.c | 4 +- sys/dev/raid/aac/aac.c | 2 +- sys/dev/raid/dpt/dpt_pci.c | 4 +- sys/dev/raid/hptiop/hptiop.c | 2 +- sys/dev/raid/hptmv/entry.c | 8 +-- sys/dev/raid/hptmv/gui_lib.c | 8 +-- sys/dev/raid/hptmv/hptproc.c | 2 +- sys/dev/raid/hptmv/ioctl.c | 2 +- sys/dev/raid/vinum/vinum.c | 2 +- sys/dev/serial/stli/istallion.c | 8 +-- sys/dev/sound/isa/ad1816.c | 8 +-- sys/dev/sound/isa/ess.c | 8 +-- sys/dev/sound/isa/mss.c | 14 ++--- sys/dev/sound/isa/sb16.c | 8 +-- sys/dev/sound/isa/sb8.c | 6 +- sys/dev/sound/pci/als4000.c | 10 ++-- sys/dev/sound/pci/aureal.c | 4 +- sys/dev/sound/pci/fm801.c | 2 +- sys/dev/sound/pci/neomagic.c | 2 +- sys/dev/sound/pci/solo.c | 12 ++-- sys/dev/sound/pci/t4dwave.c | 2 +- sys/dev/sound/pci/via8233.c | 4 +- sys/dev/sound/pci/via82c686.c | 4 +- sys/dev/sound/usb/uaudio.c | 4 +- sys/dev/usbmisc/ugen/ugen.c | 10 ++-- sys/dev/usbmisc/uhid/uhid.c | 4 +- sys/dev/usbmisc/urio/urio.c | 2 +- sys/dev/usbmisc/uscanner/uscanner.c | 6 +- .../linux/i386/linprocfs/linprocfs_vnops.c | 6 +- sys/gnu/vfs/ext2fs/ext2_vfsops.c | 2 +- sys/kern/kern_p1003_1b.c | 3 +- sys/kern/kern_sysctl.c | 4 +- sys/kern/kern_time.c | 2 +- sys/kern/link_elf.c | 5 +- sys/kern/link_elf_obj.c | 6 +- sys/kern/subr_bus.c | 4 +- sys/kern/subr_prof.c | 2 +- sys/kern/subr_rman.c | 17 +++--- sys/kern/tty_pty.c | 2 +- sys/kern/tty_subr.c | 5 +- sys/kern/uipc_socket.c | 10 ++-- sys/kern/uipc_usrreq.c | 3 +- sys/kern/vfs_bio.c | 2 +- sys/kern/vfs_subr.c | 8 +-- sys/libkern/strtol.c | 3 +- sys/libkern/strtoq.c | 3 +- sys/libkern/strtoul.c | 3 +- sys/libkern/strtouq.c | 3 +- sys/net/bpf_filter.c | 11 ++-- sys/net/bridge/if_bridge.c | 6 +- sys/net/disc/if_disc.c | 5 +- sys/net/ef/if_ef.c | 2 +- sys/net/faith/if_faith.c | 3 +- sys/net/gre/if_gre.c | 2 +- sys/net/i4b/capi/iavc/iavc_isa.c | 2 +- sys/net/i4b/capi/iavc/iavc_lli.c | 3 +- sys/net/i4b/capi/iavc/iavc_pci.c | 2 +- sys/net/i4b/driver/i4b_tel.c | 8 +-- sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c | 2 +- sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c | 2 +- sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c | 2 +- sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c | 4 +- sys/net/i4b/layer1/isic/i4b_avm_a1.c | 5 +- sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c | 5 +- sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c | 2 +- sys/net/i4b/layer1/isic/i4b_isic_pnp.c | 4 +- sys/net/i4b/layer1/isic/i4b_itk_ix1.c | 5 +- sys/net/i4b/layer1/isic/i4b_tel_s016.c | 5 +- sys/net/i4b/layer1/isic/i4b_tel_s0163.c | 5 +- sys/net/i4b/layer1/isic/i4b_tel_s08.c | 5 +- sys/net/i4b/layer1/isic/i4b_usr_sti.c | 7 +-- sys/net/i4b/layer1/itjc/i4b_itjc_pci.c | 2 +- sys/net/i4b/layer1/iwic/i4b_iwic_pci.c | 2 +- sys/net/if.c | 18 +++--- sys/net/if_ethersubr.c | 4 +- sys/net/if_loop.c | 4 +- sys/net/ip6fw/ip6_fw.c | 19 +++---- sys/net/ip_mroute/ip_mroute.c | 3 +- sys/net/ppp/if_ppp.c | 10 ++-- sys/net/sppp/if_spppsubr.c | 6 +- sys/net/tun/if_tun.c | 4 +- sys/netgraph/socket/ng_socket.c | 2 +- sys/netgraph7/atm/ccatm/ng_ccatm.c | 4 +- sys/netgraph7/ng_socket.c | 4 +- sys/netgraph7/ng_source.c | 3 +- sys/netinet/igmp.c | 2 +- sys/netinet/ip_icmp.c | 9 ++- sys/netinet/ip_output.c | 2 +- sys/netinet/raw_ip.c | 5 +- sys/netinet/sctp_input.c | 4 +- sys/netinet/sctp_usrreq.c | 8 +-- sys/netinet/sctputil.c | 2 +- sys/netinet/tcp_debug.c | 3 +- sys/netinet/tcp_input.c | 4 +- sys/netinet/tcp_usrreq.c | 2 +- sys/netinet6/ah_input.c | 5 +- sys/netinet6/esp_input.c | 5 +- sys/netinet6/icmp6.c | 5 +- sys/netinet6/in6.c | 2 +- sys/netinet6/in6_pcb.c | 4 +- sys/netinet6/in6_prefix.c | 5 +- sys/netinet6/in6_src.c | 26 ++++----- sys/netinet6/ip6_input.c | 6 +- sys/netinet6/nd6_rtr.c | 3 +- sys/netinet6/raw_ip6.c | 4 +- sys/netinet6/udp6_output.c | 3 +- sys/netinet6/udp6_usrreq.c | 3 +- sys/netproto/atm/atm_cm.c | 5 +- sys/netproto/atm/spans/spans_arp.c | 3 +- sys/netproto/atm/spans/spans_cls.c | 5 +- sys/netproto/atm/uni/unisig_msg.c | 5 +- sys/netproto/ipsec/ipsec_mbuf.c | 3 +- sys/netproto/ipsec/key.c | 2 +- sys/netproto/ipsec/keysock.c | 8 +-- sys/netproto/ipsec/xform_ipcomp.c | 3 +- sys/netproto/ipsec/xform_ipip.c | 5 +- sys/netproto/ipx/ipx_input.c | 3 +- sys/netproto/ipx/ipx_pcb.c | 2 +- sys/netproto/ipx/spx_debug.c | 3 +- sys/netproto/ipx/spx_usrreq.c | 4 +- sys/netproto/key/key.c | 2 +- sys/netproto/key/keysock.c | 6 +- sys/netproto/ncp/ncp_rq.c | 7 +-- sys/netproto/ncp/ncp_sock.c | 4 +- sys/platform/pc32/i386/db_interface.c | 9 ++- sys/platform/pc32/i386/dump_machdep.c | 2 +- sys/platform/pc32/i386/mptable.c | 5 +- sys/platform/pc32/i386/nexus.c | 4 +- sys/platform/pc32/i386/pmap.c | 4 +- sys/platform/pc32/isa/npx.c | 6 +- sys/platform/pc64/x86_64/db_interface.c | 8 +-- sys/platform/pc64/x86_64/db_trace.c | 2 +- sys/platform/pc64/x86_64/dump_machdep.c | 2 +- sys/platform/pc64/x86_64/nexus.c | 4 +- sys/platform/pc64/x86_64/pmap.c | 4 +- sys/platform/vkernel/i386/db_interface.c | 9 ++- sys/platform/vkernel/i386/db_trace.c | 2 +- sys/platform/vkernel/platform/pmap.c | 2 +- sys/platform/vkernel64/platform/init.c | 4 +- sys/platform/vkernel64/platform/pmap.c | 2 +- sys/platform/vkernel64/x86_64/db_interface.c | 9 ++- sys/platform/vkernel64/x86_64/db_trace.c | 2 +- sys/vfs/hpfs/hpfs_vfsops.c | 2 +- sys/vfs/isofs/cd9660/cd9660_lookup.c | 3 +- sys/vfs/isofs/cd9660/cd9660_vfsops.c | 6 +- sys/vfs/msdosfs/msdosfs_conv.c | 4 +- sys/vfs/msdosfs/msdosfs_fat.c | 5 +- sys/vfs/msdosfs/msdosfs_lookup.c | 5 +- sys/vfs/nfs/nfs_node.c | 4 +- sys/vfs/nfs/nfs_socket.c | 4 +- sys/vfs/nfs/nfs_srvcache.c | 4 +- sys/vfs/nfs/nfs_syscalls.c | 2 +- sys/vfs/portal/portal_vnops.c | 10 ++-- sys/vfs/procfs/procfs_status.c | 4 +- sys/vfs/udf/udf_vfsops.c | 3 +- sys/vfs/ufs/ffs_alloc.c | 5 +- sys/vfs/ufs/ffs_softdep.c | 10 ++-- sys/vfs/ufs/ffs_vfsops.c | 2 +- sys/vfs/union/union_subr.c | 6 +- sys/vfs/union/union_vfsops.c | 7 +-- sys/vm/vm_zone.c | 5 +- 203 files changed, 498 insertions(+), 568 deletions(-) diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c index c3db8c6101..32d7c7c386 100644 --- a/sys/boot/efi/libefi/efinet.c +++ b/sys/boot/efi/libefi/efinet.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/efi/libefi/efinet.c,v 1.5 2002/07/20 03:52:18 peter Exp $ - * $DragonFly: src/sys/boot/efi/libefi/efinet.c,v 1.1 2003/11/10 06:08:33 dillon Exp $ */ #include @@ -104,13 +103,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/efi/loader/main.c b/sys/boot/efi/loader/main.c index 703b58a511..fbd0c9cbe3 100644 --- a/sys/boot/efi/loader/main.c +++ b/sys/boot/efi/loader/main.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/efi/loader/main.c,v 1.20 2003/08/02 08:22:03 marcel Exp $ - * $DragonFly: src/sys/boot/efi/loader/main.c,v 1.1 2003/11/10 06:08:33 dillon Exp $ */ #include @@ -66,7 +65,7 @@ static void find_pal_proc(void) { int i; - struct sal_system_table *saltab = 0; + struct sal_system_table *saltab = NULL; static int sizes[6] = { 48, 32, 16, 32, 16, 16 }; @@ -316,7 +315,7 @@ static int command_sal(int argc, char *argv[]) { int i; - struct sal_system_table *saltab = 0; + struct sal_system_table *saltab = NULL; static int sizes[6] = { 48, 32, 16, 32, 16, 16 }; diff --git a/sys/boot/pc32/libi386/biossmap.c b/sys/boot/pc32/libi386/biossmap.c index 76b78fc216..75ffa17dfb 100644 --- a/sys/boot/pc32/libi386/biossmap.c +++ b/sys/boot/pc32/libi386/biossmap.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/biossmap.c,v 1.2 2003/08/25 23:28:31 obrien Exp $ - * $DragonFly: src/sys/boot/pc32/libi386/biossmap.c,v 1.2 2003/11/22 19:30:55 asmodai Exp $ */ /* @@ -99,7 +98,7 @@ bios_addsmapdata(struct preloaded_file *kfp) { int len; - if (smapbase == 0 || smaplen == 0) + if (smapbase == NULL || smaplen == 0) return; len = smaplen * sizeof(*smapbase); file_addmetadata(kfp, MODINFOMD_SMAP, len, smapbase); diff --git a/sys/bus/cam/cam_extend.c b/sys/bus/cam/cam_extend.c index 2ef566e7b1..d5f29a502e 100644 --- a/sys/bus/cam/cam_extend.c +++ b/sys/bus/cam/cam_extend.c @@ -13,7 +13,6 @@ * functioning of this software in any circumstances. * * $FreeBSD: src/sys/cam/cam_extend.c,v 1.3 1999/08/28 00:40:39 peter Exp $ - * $DragonFly: src/sys/bus/cam/cam_extend.c,v 1.8 2006/12/22 23:12:16 swildner Exp $ */ /* * XXX XXX XXX XXX We should get DEVFS working so that we @@ -92,6 +91,6 @@ cam_extend_release(struct extend_array *ea, int index) { void *p = cam_extend_get(ea, index); if (p) { - ea->ps[index] = 0; + ea->ps[index] = NULL; } } diff --git a/sys/bus/cam/scsi/scsi_da.c b/sys/bus/cam/scsi/scsi_da.c index 2a566fc30e..e8751e204d 100644 --- a/sys/bus/cam/scsi/scsi_da.c +++ b/sys/bus/cam/scsi/scsi_da.c @@ -1331,7 +1331,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb) /* Run the trim command if not already running */ if (!softc->trim_running && - (bio = bioq_first(&softc->bio_queue_trim)) != 0) { + (bio = bioq_first(&softc->bio_queue_trim)) != NULL) { struct trim_request *req = &softc->trim_req; struct bio *bio1; int bps = 0, ranges = 0; diff --git a/sys/bus/iicbus/pcf/pcf.c b/sys/bus/iicbus/pcf/pcf.c index 84225d3636..6c0524c291 100644 --- a/sys/bus/iicbus/pcf/pcf.c +++ b/sys/bus/iicbus/pcf/pcf.c @@ -143,13 +143,13 @@ pcf_probe(device_t pcfdev) bzero(pcf, sizeof(struct pcf_softc)); pcf->rid_irq = pcf->rid_ioport = 0; - pcf->res_irq = pcf->res_ioport = 0; + pcf->res_irq = pcf->res_ioport = NULL; /* IO port is mandatory */ pcf->res_ioport = bus_alloc_resource(pcfdev, SYS_RES_IOPORT, &pcf->rid_ioport, 0ul, ~0ul, IO_PCFSIZE, RF_ACTIVE); - if (pcf->res_ioport == 0) { + if (pcf->res_ioport == NULL) { device_printf(pcfdev, "cannot reserve I/O port range\n"); goto error; } @@ -161,7 +161,7 @@ pcf_probe(device_t pcfdev) if (!(pcf->pcf_flags & IIC_POLLED)) { pcf->res_irq = bus_alloc_resource(pcfdev, SYS_RES_IRQ, &pcf->rid_irq, 0ul, ~0ul, 1, RF_ACTIVE); - if (pcf->res_irq == 0) { + if (pcf->res_irq == NULL) { device_printf(pcfdev, "can't reserve irq, polled mode.\n"); pcf->pcf_flags |= IIC_POLLED; } @@ -172,7 +172,7 @@ pcf_probe(device_t pcfdev) return (0); error: - if (pcf->res_ioport != 0) { + if (pcf->res_ioport != NULL) { bus_deactivate_resource(pcfdev, SYS_RES_IOPORT, pcf->rid_ioport, pcf->res_ioport); bus_release_resource(pcfdev, SYS_RES_IOPORT, pcf->rid_ioport, diff --git a/sys/bus/isa/i386/isa_compat.c b/sys/bus/isa/i386/isa_compat.c index 9b769e5b1a..db2a2f2213 100644 --- a/sys/bus/isa/i386/isa_compat.c +++ b/sys/bus/isa/i386/isa_compat.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/isa_compat.c,v 1.18.2.1 2001/05/17 23:05:06 imp Exp $ - * $DragonFly: src/sys/bus/isa/i386/isa_compat.c,v 1.12 2006/12/22 23:12:16 swildner Exp $ */ #include @@ -82,7 +81,7 @@ isa_compat_alloc_resources(device_t dev, struct isa_compat_resources *res) kprintf("isa_compat: didn't get ports for %s\n", device_get_name(dev)); } else - res->ports = 0; + res->ports = NULL; if (bus_get_resource(dev, SYS_RES_MEMORY, 0, &start, &count) == 0 @@ -95,7 +94,7 @@ isa_compat_alloc_resources(device_t dev, struct isa_compat_resources *res) kprintf("isa_compat: didn't get memory for %s\n", device_get_name(dev)); } else - res->memory = 0; + res->memory = NULL; if (bus_get_resource(dev, SYS_RES_DRQ, 0, &start, &count) == 0) { @@ -107,7 +106,7 @@ isa_compat_alloc_resources(device_t dev, struct isa_compat_resources *res) kprintf("isa_compat: didn't get drq for %s\n", device_get_name(dev)); } else - res->drq = 0; + res->drq = NULL; if (bus_get_resource(dev, SYS_RES_IRQ, 0, &start, &count) == 0) { @@ -119,7 +118,7 @@ isa_compat_alloc_resources(device_t dev, struct isa_compat_resources *res) kprintf("isa_compat: didn't get irq for %s\n", device_get_name(dev)); } else - res->irq = 0; + res->irq = NULL; } static void @@ -127,19 +126,19 @@ isa_compat_release_resources(device_t dev, struct isa_compat_resources *res) { if (res->ports) { bus_release_resource(dev, SYS_RES_IOPORT, 0, res->ports); - res->ports = 0; + res->ports = NULL; } if (res->memory) { bus_release_resource(dev, SYS_RES_MEMORY, 0, res->memory); - res->memory = 0; + res->memory = NULL; } if (res->drq) { bus_release_resource(dev, SYS_RES_DRQ, 0, res->drq); - res->drq = 0; + res->drq = NULL; } if (res->irq) { bus_release_resource(dev, SYS_RES_IRQ, 0, res->irq); - res->irq = 0; + res->irq = NULL; } } @@ -204,7 +203,7 @@ isa_compat_probe(device_t dev) if (res.memory) maddr = rman_get_virtual(res.memory); else - maddr = 0; + maddr = NULL; dvp->id_maddr = maddr; old = *dvp; portsize = dvp->id_driver->probe(dvp); diff --git a/sys/bus/isa/pnp.c b/sys/bus/isa/pnp.c index 2ba9741065..566e0af52d 100644 --- a/sys/bus/isa/pnp.c +++ b/sys/bus/isa/pnp.c @@ -439,14 +439,14 @@ static int pnp_create_devices(device_t parent, pnp_id *p, int csn, u_char *resources, int len) { - u_char tag, *resp, *resinfo, *startres = 0; + u_char tag, *resp, *resinfo, *startres = NULL; int large_len, scanning = len, retval = FALSE; u_int32_t logical_id; device_t dev = 0; int ldn = 0; struct pnp_set_config_arg *csnldn; char buf[100]; - char *desc = 0; + char *desc = NULL; resp = resources; while (scanning > 0) { @@ -508,7 +508,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, pnp_parse_resources(dev, startres, resinfo - startres - 1, ldn); dev = 0; - startres = 0; + startres = NULL; } /* @@ -543,7 +543,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, pnp_parse_resources(dev, startres, resinfo - startres - 1, ldn); dev = 0; - startres = 0; + startres = NULL; scanning = 0; break; @@ -670,7 +670,7 @@ pnp_isolation_protocol(device_t parent) int csn; pnp_id id; int found = 0, len; - u_char *resources = 0; + u_char *resources = NULL; int space = 0; int error; diff --git a/sys/bus/pccard/pccard.c b/sys/bus/pccard/pccard.c index 3af2b36b77..2c2193666c 100644 --- a/sys/bus/pccard/pccard.c +++ b/sys/bus/pccard/pccard.c @@ -410,7 +410,7 @@ pccard_function_init(struct pccard_function *pf) struct pccard_ivar *devi = PCCARD_IVAR(pf->dev); struct resource_list *rl = &devi->resources; struct resource_list_entry *rle; - struct resource *r = 0; + struct resource *r = NULL; device_t bus; u_long start, end, len; int i, rid, spaces; @@ -1106,7 +1106,7 @@ pccard_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags, int cpuid) { struct pccard_ivar *dinfo; - struct resource_list_entry *rle = 0; + struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != dev); int isdefault = (start == 0 && end == ~0UL && count == 1); struct resource *r = NULL; @@ -1157,7 +1157,7 @@ pccard_release_resource(device_t dev, device_t child, int type, int rid, { struct pccard_ivar *dinfo; int passthrough = (device_get_parent(child) != dev); - struct resource_list_entry *rle = 0; + struct resource_list_entry *rle = NULL; if (passthrough) return BUS_RELEASE_RESOURCE(device_get_parent(dev), child, diff --git a/sys/bus/ppbus/ppbconf.c b/sys/bus/ppbus/ppbconf.c index 8969aeccc5..cab1a021b5 100644 --- a/sys/bus/ppbus/ppbconf.c +++ b/sys/bus/ppbus/ppbconf.c @@ -213,7 +213,7 @@ search_token(char *str, int slen, char *token) static int ppb_pnp_detect(device_t bus) { - char *token, *class = 0; + char *token, *class = NULL; int i, len, error; int class_id = -1; char str[PPB_PnP_STRING_SIZE+1]; diff --git a/sys/bus/usb/uhci.c b/sys/bus/usb/uhci.c index 221338e4db..08814fd87c 100644 --- a/sys/bus/usb/uhci.c +++ b/sys/bus/usb/uhci.c @@ -1674,7 +1674,7 @@ uhci_alloc_std_chain(struct uhci_pipe *upipe, uhci_softc_t *sc, int len, ntd++; DPRINTFN(10, ("uhci_alloc_std_chain: maxp=%d ntd=%d\n", maxp, ntd)); if (ntd == 0) { - *sp = *ep = 0; + *sp = *ep = NULL; DPRINTFN(-1,("uhci_alloc_std_chain: ntd=0\n")); return (USBD_NORMAL_COMPLETION); } @@ -2534,7 +2534,7 @@ uhci_setup_isoc(usbd_pipe_handle pipe) /* Allocate the TDs and mark as inactive; */ for (i = 0; i < UHCI_VFRAMELIST_COUNT; i++) { std = uhci_alloc_std(sc); - if (std == 0) + if (std == NULL) goto bad; std->td.td_status = htole32(UHCI_TD_IOS); /* iso, inactive */ std->td.td_token = htole32(token); diff --git a/sys/bus/usb/usb.c b/sys/bus/usb/usb.c index 7551653d2e..5669c20024 100644 --- a/sys/bus/usb/usb.c +++ b/sys/bus/usb/usb.c @@ -624,7 +624,7 @@ usbioctl(struct dev_ioctl_args *ap) size_t len = UGETW(ur->ucr_request.wLength); struct iovec iov; struct uio uio; - void *ptr = 0; + void *ptr = NULL; int addr = ur->ucr_addr; usbd_status err; int error = 0; diff --git a/sys/bus/usb/usb_subr.c b/sys/bus/usb/usb_subr.c index 71bb73073f..089ed939c5 100644 --- a/sys/bus/usb/usb_subr.c +++ b/sys/bus/usb/usb_subr.c @@ -178,7 +178,7 @@ static void usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev) { usb_device_descriptor_t *udd = &dev->ddesc; - char *vendor = 0, *product = 0; + char *vendor = NULL, *product = NULL; if (dev == NULL) { v[0] = p[0] = '\0'; diff --git a/sys/cpu/i386/misc/db_disasm.c b/sys/cpu/i386/misc/db_disasm.c index 9b0deb57ec..a0d29189d7 100644 --- a/sys/cpu/i386/misc/db_disasm.c +++ b/sys/cpu/i386/misc/db_disasm.c @@ -886,7 +886,7 @@ db_read_address(db_addr_t loc, int short_addr, int regmodrm, return (loc); } addrp->is_reg = FALSE; - addrp->index = 0; + addrp->index = NULL; addrp->ss = 0; addrp->defss = 0; @@ -913,7 +913,7 @@ db_read_address(db_addr_t loc, int short_addr, int regmodrm, if (rm == 6) { get_value_inc(disp, loc, 2, FALSE); addrp->disp = disp; - addrp->base = 0; + addrp->base = NULL; } else { addrp->disp = 0; @@ -946,7 +946,7 @@ db_read_address(db_addr_t loc, int short_addr, int regmodrm, case 0: if (rm == 5) { get_value_inc(addrp->disp, loc, 4, FALSE); - addrp->base = 0; + addrp->base = NULL; } else { addrp->disp = 0; @@ -985,7 +985,7 @@ db_print_address(const char *seg, int size, struct i_addr *addrp) } db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY); - if (addrp->base != 0 || addrp->index != 0) { + if (addrp->base != NULL || addrp->index != NULL) { db_printf("("); if (addrp->base) db_printf("%s", addrp->base); @@ -1115,7 +1115,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt, db_regs_t *regs) struct i_addr address; get_value_inc(inst, loc, 1, FALSE); - seg = 0; + seg = NULL; #ifdef _GDT_ARRAY_PRESENT if (regs && gdt[mycpu->gd_cpuid * NGDT + IDXSEL(regs->tf_cs & 0xFFFF)].sd.sd_def32 == 0) { @@ -1185,7 +1185,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt, db_regs_t *regs) if (inst == 0x0f) { get_value_inc(inst, loc, 1, FALSE); ip = db_inst_0f[inst>>4]; - if (ip == 0) { + if (ip == NULL) { ip = &db_bad_inst; } else { diff --git a/sys/cpu/x86_64/misc/db_disasm.c b/sys/cpu/x86_64/misc/db_disasm.c index 787b427ed0..fed00bad4f 100644 --- a/sys/cpu/x86_64/misc/db_disasm.c +++ b/sys/cpu/x86_64/misc/db_disasm.c @@ -949,7 +949,7 @@ db_read_address(db_addr_t loc, int short_addr, int rex, int regmodrm, return (loc); } addrp->is_reg = FALSE; - addrp->index = 0; + addrp->index = NULL; if (short_addr) size = LONG; @@ -972,7 +972,7 @@ db_read_address(db_addr_t loc, int short_addr, int rex, int regmodrm, if (rm == 5) { get_value_inc(addrp->disp, loc, 4, FALSE); if (have_sib) - addrp->base = 0; + addrp->base = NULL; else if (short_addr) addrp->base = "%eip"; else @@ -1010,9 +1010,9 @@ db_print_address(const char *seg, int size, int rex, struct i_addr *addrp) db_printf("%s:", seg); } - if (addrp->disp != 0 || (addrp->base == 0 && addrp->index == 0)) + if (addrp->disp != 0 || (addrp->base == NULL && addrp->index == NULL)) db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY); - if (addrp->base != 0 || addrp->index != 0) { + if (addrp->base != NULL || addrp->index != NULL) { db_printf("("); if (addrp->base) db_printf("%s", addrp->base); @@ -1143,7 +1143,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt, db_regs_t *dummy) get_value_inc(inst, loc, 1, FALSE); short_addr = FALSE; size = LONG; - seg = 0; + seg = NULL; /* * Get prefixes @@ -1206,7 +1206,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt, db_regs_t *dummy) if (inst == 0x0f) { get_value_inc(inst, loc, 1, FALSE); ip = db_inst_0f[inst>>4]; - if (ip == 0) { + if (ip == NULL) { ip = &db_bad_inst; } else { diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index 0edec107f9..43dae28ad4 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -24,7 +24,6 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_aout.c,v 1.27 1999/08/28 00:41:05 peter Exp $ - * $DragonFly: src/sys/ddb/db_aout.c,v 1.8 2006/12/28 21:24:01 dillon Exp $ */ /* @@ -152,7 +151,7 @@ X_db_search_symbol(db_symtab_t *symtab, db_addr_t off, db_strategy_t strategy, db_expr_t *diffp) { unsigned int diff = *diffp; - struct nlist *symp = 0; + struct nlist *symp = NULL; struct nlist *sp, *ep; sp = (struct nlist *)symtab->start; @@ -177,7 +176,7 @@ X_db_search_symbol(db_symtab_t *symtab, db_addr_t off, db_strategy_t strategy, } } else if (off - sp->n_value == diff) { - if (symp == 0) + if (symp == NULL) symp = sp; else if ((symp->n_type & N_EXT) == 0 && (sp->n_type & N_EXT) != 0) @@ -185,7 +184,7 @@ X_db_search_symbol(db_symtab_t *symtab, db_addr_t off, db_strategy_t strategy, } } } - if (symp == 0) { + if (symp == NULL) { *diffp = off; } else { diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 0607ffaa7e..743a031ecc 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -124,7 +124,7 @@ static struct command db_command_table[] = { { NULL, } }; -static struct command *db_last_command = 0; +static struct command *db_last_command = NULL; /* * if 'ed' style: 'dot' is set at start of last item printed, @@ -210,7 +210,7 @@ db_cmd_search(char *name, struct command *table, struct command **aux_tablep, } } } - if (result == CMD_NONE && aux_tablep != 0) + if (result == CMD_NONE && aux_tablep != NULL) /* XXX repeat too much code. */ for (aux_cmdp = aux_tablep; aux_cmdp < aux_tablep_end; aux_cmdp++) { char *lp; @@ -262,7 +262,7 @@ db_cmd_list(struct command *table, struct command **aux_tablep, db_printf("%-12s", cmd->name); db_end_line(); } - if (aux_tablep == 0) + if (aux_tablep == NULL) return; for (aux_cmdp = aux_tablep; aux_cmdp < aux_tablep_end; aux_cmdp++) { db_printf("%-12s", (*aux_cmdp)->name); @@ -330,9 +330,9 @@ db_command(struct command **last_cmdp, struct command *cmd_table, default: break; } - if ((cmd_table = cmd->more) != 0) { + if ((cmd_table = cmd->more) != NULL) { /* XXX usually no more aux's. */ - aux_cmd_tablep = 0; + aux_cmd_tablep = NULL; if (cmd_table == db_show_cmds) { aux_cmd_tablep = SET_BEGIN(db_show_cmd_set); aux_cmd_tablep_end = SET_LIMIT(db_show_cmd_set); @@ -394,7 +394,7 @@ db_command(struct command **last_cmdp, struct command *cmd_table, } } *last_cmdp = cmd; - if (cmd != 0) { + if (cmd != NULL) { /* * Execute the command. */ diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 9a9c242856..6b8feb6c50 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -24,7 +24,6 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_sym.c,v 1.32 1999/08/28 00:41:10 peter Exp $ - * $DragonFly: src/sys/ddb/db_sym.c,v 1.7 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -213,7 +212,7 @@ db_search_symbol(db_addr_t val, db_strategy_t strategy, db_expr_t *offp) c_db_sym_t ret = C_DB_SYM_NULL, sym; newdiff = diff = ~0; - db_last_symtab = 0; + db_last_symtab = NULL; for (i = 0; i < db_nsymtab; i++) { sym = X_db_search_symbol(&db_symtabs[i], val, strategy, &newdiff); if (newdiff < diff) { @@ -235,7 +234,7 @@ db_symbol_values(c_db_sym_t sym, const char **namep, db_expr_t *valuep) db_expr_t value; if (sym == DB_SYM_NULL) { - *namep = 0; + *namep = NULL; return; } @@ -278,13 +277,13 @@ db_printsym(db_expr_t off, db_strategy_t strategy) cursym = db_search_symbol(off, strategy, &d); db_symbol_values(cursym, &name, &value); - if (name == 0) + if (name == NULL) value = off; if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) { db_printf("%+#lr", (long)off); return; } - if (name == 0 || d >= (unsigned long)db_maxoff) { + if (name == NULL || d >= (unsigned long)db_maxoff) { db_printf("%#lr", (unsigned long)off); return; } diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index c4074cddbd..58d5ce29d5 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -789,7 +789,7 @@ agp_close(struct dev_close_args *ap) /* * Clear the GATT and force release on last close */ - while ((mem = TAILQ_FIRST(&sc->as_memory)) != 0) { + while ((mem = TAILQ_FIRST(&sc->as_memory)) != NULL) { if (mem->am_is_bound) AGP_UNBIND_MEMORY(dev, mem); AGP_FREE_MEMORY(dev, mem); diff --git a/sys/dev/atm/hfa/fore_buffer.c b/sys/dev/atm/hfa/fore_buffer.c index 9128a5cddf..90aa49483d 100644 --- a/sys/dev/atm/hfa/fore_buffer.c +++ b/sys/dev/atm/hfa/fore_buffer.c @@ -24,7 +24,6 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hfa/fore_buffer.c,v 1.5 2000/01/15 21:01:04 mks Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_buffer.c,v 1.6 2008/06/05 18:06:31 swildner Exp $ */ /* @@ -359,7 +358,7 @@ fore_buf_supply_1s(Fore_unit *fup) * Get a small buffer */ KB_ALLOCPKT(m, BUF1_SM_SIZE, KB_F_NOWAIT, KB_T_DATA); - if (m == 0) { + if (m == NULL) { break; } KB_HEADSET(m, BUF1_SM_DOFF); @@ -500,7 +499,7 @@ fore_buf_supply_1l(Fore_unit *fup) * Get a cluster buffer */ KB_ALLOCEXT(m, BUF1_LG_SIZE, KB_F_NOWAIT, KB_T_DATA); - if (m == 0) { + if (m == NULL) { break; } KB_HEADSET(m, BUF1_LG_DOFF); diff --git a/sys/dev/disk/aic/aic_isa.c b/sys/dev/disk/aic/aic_isa.c index 48ea5af4f0..f6805bd204 100644 --- a/sys/dev/disk/aic/aic_isa.c +++ b/sys/dev/disk/aic/aic_isa.c @@ -66,7 +66,7 @@ aic_isa_alloc_resources(device_t dev) struct aic_isa_softc *sc = device_get_softc(dev); int rid; - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; rid = 0; sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, @@ -115,7 +115,7 @@ aic_isa_release_resources(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); if (sc->sc_drq) bus_release_resource(dev, SYS_RES_DRQ, 0, sc->sc_drq); - sc->sc_port = sc->sc_irq = sc->sc_drq = 0; + sc->sc_port = sc->sc_irq = sc->sc_drq = NULL; } static int diff --git a/sys/dev/disk/aic/aic_pccard.c b/sys/dev/disk/aic/aic_pccard.c index 9f7460a176..2f7e861b22 100644 --- a/sys/dev/disk/aic/aic_pccard.c +++ b/sys/dev/disk/aic/aic_pccard.c @@ -68,7 +68,7 @@ aic_pccard_alloc_resources(device_t dev) struct aic_pccard_softc *sc = device_get_softc(dev); int rid; - sc->sc_port = sc->sc_irq = 0; + sc->sc_port = sc->sc_irq = NULL; rid = 0; sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, @@ -98,7 +98,7 @@ aic_pccard_release_resources(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port); if (sc->sc_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); - sc->sc_port = sc->sc_irq = 0; + sc->sc_port = sc->sc_irq = NULL; } static int diff --git a/sys/dev/disk/ata/atapi-cd.c b/sys/dev/disk/ata/atapi-cd.c index 37f6b6ebc8..bad9ba24e7 100644 --- a/sys/dev/disk/ata/atapi-cd.c +++ b/sys/dev/disk/ata/atapi-cd.c @@ -26,7 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.48.2.20 2002/11/25 05:30:31 njl Exp $ - * $DragonFly: src/sys/dev/disk/ata/atapi-cd.c,v 1.37 2008/01/06 16:55:49 swildner Exp $ */ #include "opt_ata.h" @@ -388,7 +387,7 @@ acd_describe(struct acd_softc *cdp) case MST_MECH_CARTRIDGE: mechanism = "cartridge"; break; default: - mechanism = 0; break; + mechanism = NULL; break; } if (mechanism) kprintf("%s%s", cdp->cap.eject ? "ejectable " : "", mechanism); diff --git a/sys/dev/disk/buslogic/bt_isa.c b/sys/dev/disk/buslogic/bt_isa.c index c23cfd1d22..e02096c2e7 100644 --- a/sys/dev/disk/buslogic/bt_isa.c +++ b/sys/dev/disk/buslogic/bt_isa.c @@ -69,7 +69,7 @@ bt_isa_alloc_resources(device_t dev, u_long portstart, u_long portend) return (ENOMEM); } } else - irq = 0; + irq = NULL; if (isa_get_drq(dev) != -1) { rid = 0; @@ -85,7 +85,7 @@ bt_isa_alloc_resources(device_t dev, u_long portstart, u_long portend) return (ENOMEM); } } else - drq = 0; + drq = NULL; bt_init_softc(dev, port, irq, drq); diff --git a/sys/dev/disk/buslogic/bt_pci.c b/sys/dev/disk/buslogic/bt_pci.c index 49ec293e83..84e1b24ed3 100644 --- a/sys/dev/disk/buslogic/bt_pci.c +++ b/sys/dev/disk/buslogic/bt_pci.c @@ -52,8 +52,8 @@ static int bt_pci_alloc_resources(device_t dev) { int command, type = 0, rid, zero; - struct resource *regs = 0; - struct resource *irq = 0; + struct resource *regs = NULL; + struct resource *irq = NULL; command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); #if 0 diff --git a/sys/dev/disk/isp/isp_pci.c b/sys/dev/disk/isp/isp_pci.c index 0e8c2f9de3..4df2e4eb93 100644 --- a/sys/dev/disk/isp/isp_pci.c +++ b/sys/dev/disk/isp/isp_pci.c @@ -571,8 +571,8 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) if (resource_int_value(device_get_name(dev), device_get_unit(dev), "fullduplex", &tval) == 0 && tval != 0) { isp->isp_confopts |= ISP_CFG_FULL_DUPLEX; } - sptr = 0; - if (resource_string_value(device_get_name(dev), device_get_unit(dev), "topology", &sptr) == 0 && sptr != 0) { + sptr = NULL; + if (resource_string_value(device_get_name(dev), device_get_unit(dev), "topology", &sptr) == 0 && sptr != NULL) { if (strcmp(sptr, "lport") == 0) { isp->isp_confopts |= ISP_CFG_LPORT; } else if (strcmp(sptr, "nport") == 0) { @@ -592,10 +592,10 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) * hint replacement to specify WWN strings with a leading * 'w' (e..g w50000000aaaa0001). Sigh. */ - sptr = 0; + sptr = NULL; tval = resource_string_value(device_get_name(dev), device_get_unit(dev), "portwwn", &sptr); - if (tval == 0 && sptr != 0 && *sptr++ == 'w') { - char *eptr = 0; + if (tval == 0 && sptr != NULL && *sptr++ == 'w') { + char *eptr = NULL; ISP_FC_PC(isp, chan)->def_wwpn = strtouq(sptr, &eptr, 16); if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwpn == -1) { device_printf(dev, "mangled portwwn hint '%s'\n", sptr); @@ -603,10 +603,10 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) } } - sptr = 0; + sptr = NULL; tval = resource_string_value(device_get_name(dev), device_get_unit(dev), "nodewwn", &sptr); - if (tval == 0 && sptr != 0 && *sptr++ == 'w') { - char *eptr = 0; + if (tval == 0 && sptr != NULL && *sptr++ == 'w') { + char *eptr = NULL; ISP_FC_PC(isp, chan)->def_wwnn = strtouq(sptr, &eptr, 16); if (eptr < sptr + 16 || ISP_FC_PC(isp, chan)->def_wwnn == 0) { device_printf(dev, "mangled nodewwn hint '%s'\n", sptr); diff --git a/sys/dev/disk/md/md.c b/sys/dev/disk/md/md.c index 72e3b3e304..1eed7d756f 100644 --- a/sys/dev/disk/md/md.c +++ b/sys/dev/disk/md/md.c @@ -249,12 +249,12 @@ mdstrategy_malloc(struct dev_strategy_args *ap) secp = *secpp; secval = 0; } else { - secp = 0; + secp = NULL; secval = (u_int)(uintptr_t)*secpp; } } else { - secpp = 0; - secp = 0; + secpp = NULL; + secp = NULL; secval = 0; } if (md_debug > 2) @@ -265,7 +265,7 @@ mdstrategy_malloc(struct dev_strategy_args *ap) if (secpp) { if (secp) kfree(secp, M_MDSECT); - *secpp = 0; + *secpp = NULL; } break; case BUF_CMD_READ: diff --git a/sys/dev/disk/mps/mps_sas.c b/sys/dev/disk/mps/mps_sas.c index 1e50f55d34..bc34cecbb1 100644 --- a/sys/dev/disk/mps/mps_sas.c +++ b/sys/dev/disk/mps/mps_sas.c @@ -1043,7 +1043,7 @@ mpssas_scsiio_timeout(void *data) ccb = cm->cm_complete_data; targ = cm->cm_targ; - if (targ == 0x00) + if (targ == NULL) /* Driver bug */ targ = &sc->sassc->targets[ccb->ccb_h.target_id]; diff --git a/sys/dev/disk/mpt/mpt_raid.c b/sys/dev/disk/mpt/mpt_raid.c index 4ce64d5a24..e44b606218 100644 --- a/sys/dev/disk/mpt/mpt_raid.c +++ b/sys/dev/disk/mpt/mpt_raid.c @@ -578,7 +578,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt, struct mpt_raid_volume *vol, rap->Function = MPI_FUNCTION_RAID_ACTION; rap->VolumeID = vol->config_page->VolumeID; rap->VolumeBus = vol->config_page->VolumeBus; - if (disk != 0) + if (disk != NULL) rap->PhysDiskNum = disk->config_page.PhysDiskNum; else rap->PhysDiskNum = 0xFF; diff --git a/sys/dev/disk/nata/atapi-cd.c b/sys/dev/disk/nata/atapi-cd.c index 12926bae33..c9b8162d81 100644 --- a/sys/dev/disk/nata/atapi-cd.c +++ b/sys/dev/disk/nata/atapi-cd.c @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.196 2007/11/19 21:11:26 sos Exp $ - * $DragonFly: src/sys/dev/disk/nata/atapi-cd.c,v 1.12 2008/06/27 01:24:46 dillon Exp $ */ #include "opt_ata.h" @@ -1903,7 +1902,7 @@ acd_describe(device_t dev) case MST_MECH_CARTRIDGE: mechanism = "cartridge"; break; default: - mechanism = 0; break; + mechanism = NULL; break; } if (mechanism) kprintf("%s%s", (cdp->cap.mechanism & MST_EJECT) ? diff --git a/sys/dev/disk/ncr/ncr.c b/sys/dev/disk/ncr/ncr.c index 95aed29069..916c0b8f69 100644 --- a/sys/dev/disk/ncr/ncr.c +++ b/sys/dev/disk/ncr/ncr.c @@ -5263,7 +5263,7 @@ static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat) } else { script_ofs = dsp; script_size = 0; - script_base = 0; + script_base = NULL; script_name = "mem"; } @@ -5866,7 +5866,7 @@ void ncr_int_sir (ncb_p np) u_char scntl3; u_char chg, ofs, per, fak, wide; u_char num = INB (nc_dsps); - nccb_p cp=0; + nccb_p cp=NULL; u_long dsa; u_int target = INB (nc_sdid) & 0x0f; tcb_p tp = &np->target[target]; diff --git a/sys/dev/disk/sym/sym_hipd.c b/sys/dev/disk/sym/sym_hipd.c index f97bb2e49e..30ad4a2678 100644 --- a/sys/dev/disk/sym/sym_hipd.c +++ b/sys/dev/disk/sym/sym_hipd.c @@ -268,7 +268,7 @@ static __inline struct sym_quehead *sym_remque_head(struct sym_quehead *head) if (elem != head) __sym_que_del(head, elem->flink); else - elem = 0; + elem = NULL; return elem; } @@ -281,7 +281,7 @@ static __inline struct sym_quehead *sym_remque_tail(struct sym_quehead *head) if (elem != head) __sym_que_del(elem->blink, head); else - elem = 0; + elem = NULL; return elem; } @@ -497,7 +497,7 @@ static void *___sym_malloc(m_pool_s *mp, int size) if (s == MEMO_CLUSTER_SIZE) { h[j].next = (m_link_s *) M_GETP(); if (h[j].next) - h[j].next->next = 0; + h[j].next->next = NULL; break; } ++j; @@ -510,7 +510,7 @@ static void *___sym_malloc(m_pool_s *mp, int size) j -= 1; s >>= 1; h[j].next = (m_link_s *) (a+s); - h[j].next->next = 0; + h[j].next->next = NULL; } } #ifdef DEBUG @@ -682,7 +682,7 @@ static void getbaddrcb(void *arg, bus_dma_segment_t *segs, int nseg, int error) static m_addr_t ___dma_getp(m_pool_s *mp) { m_vtob_s *vbp; - void *vaddr = 0; + void *vaddr = NULL; bus_addr_t baddr = 0; vbp = __sym_calloc(&mp0, sizeof(*vbp), "VTOB"); @@ -745,7 +745,7 @@ static __inline m_pool_s *___get_dma_pool(bus_dma_tag_t dev_dmat) static m_pool_s *___cre_dma_pool(bus_dma_tag_t dev_dmat) { - m_pool_s *mp = 0; + m_pool_s *mp = NULL; mp = __sym_calloc(&mp0, sizeof(*mp), "MPOOL"); if (mp) { @@ -787,7 +787,7 @@ static void ___del_dma_pool(m_pool_s *p) static void *__sym_calloc_dma(bus_dma_tag_t dev_dmat, int size, char *name) { struct m_pool *mp; - void *m = 0; + void *m = NULL; /* Lock */ mp = ___get_dma_pool(dev_dmat); @@ -824,7 +824,7 @@ static m_addr_t __vtobus(bus_dma_tag_t dev_dmat, void *m) { m_pool_s *mp; int hc = VTOB_HASH_CODE(m); - m_vtob_s *vp = 0; + m_vtob_s *vp = NULL; m_addr_t a = ((m_addr_t) m) & ~MEMO_CLUSTER_MASK; /* Lock */ @@ -3884,7 +3884,7 @@ static void sym_log_hard_error(hcb_p np, u_short sist, u_char dstat) } else { script_ofs = dsp; script_size = 0; - script_base = 0; + script_base = NULL; script_name = "mem"; } @@ -4476,7 +4476,7 @@ static void sym_int_ma (hcb_p np) * try to find the interrupted script command, * and the address at which to continue. */ - vdsp = 0; + vdsp = NULL; nxtdsp = 0; if (dsp > np->scripta_ba && dsp <= np->scripta_ba + np->scripta_sz) { @@ -4854,7 +4854,7 @@ static void sym_sir_bad_scsi_status(hcb_p np, int num, ccb_p cp) */ #ifdef SYM_CONF_IARB_SUPPORT if (np->last_cp) - np->last_cp = 0; + np->last_cp = NULL; #endif /* @@ -5021,7 +5021,7 @@ sym_clear_tasks(hcb_p np, int cam_status, int target, int lun, int task) * the COMP queue and put back other ones into * the BUSY queue. */ - while ((qp = sym_remque_head(&qtmp)) != 0) { + while ((qp = sym_remque_head(&qtmp)) != NULL) { union ccb *ccb; cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); ccb = cp->cam_ccb; @@ -5159,7 +5159,7 @@ static void sym_sir_task_recovery(hcb_p np, int num) * we are not in race. */ i = 0; - cp = 0; + cp = NULL; FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); if (cp->host_status != HS_BUSY && @@ -5271,7 +5271,7 @@ static void sym_sir_task_recovery(hcb_p np, int num) * abort for this target. */ i = 0; - cp = 0; + cp = NULL; FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); if (cp->host_status != HS_DISCONNECT) @@ -5453,7 +5453,7 @@ static int sym_evaluate_dp(hcb_p np, ccb_p cp, u32 scr, int *ofs) else if (dp_scr == SCRIPTA_BA (np, pm1_data)) pm = &cp->phys.pm1; else - pm = 0; + pm = NULL; if (pm) { dp_scr = scr_to_cpu(pm->ret); @@ -6623,7 +6623,7 @@ static void sym_free_ccb (hcb_p np, ccb_p cp) * used for negotiation, clear this info in the tcb. */ if (cp == tp->nego_cp) - tp->nego_cp = 0; + tp->nego_cp = NULL; #ifdef SYM_CONF_IARB_SUPPORT /* @@ -6631,7 +6631,7 @@ static void sym_free_ccb (hcb_p np, ccb_p cp) * clear this info that is no longer relevant. */ if (cp == np->last_cp) - np->last_cp = 0; + np->last_cp = NULL; #endif #ifdef FreeBSD_Bus_Dma_Abstraction @@ -6647,7 +6647,7 @@ static void sym_free_ccb (hcb_p np, ccb_p cp) /* * Make this CCB available. */ - cp->cam_ccb = 0; + cp->cam_ccb = NULL; cp->host_status = HS_IDLE; sym_remque(&cp->link_ccbq); sym_insque_head(&cp->link_ccbq, &np->free_ccbq); @@ -6658,7 +6658,7 @@ static void sym_free_ccb (hcb_p np, ccb_p cp) */ static ccb_p sym_alloc_ccb(hcb_p np) { - ccb_p cp = 0; + ccb_p cp = NULL; int hcode; /* @@ -6874,7 +6874,7 @@ static void sym_alloc_lcb_tags (hcb_p np, u_char tn, u_char ln) lp->cb_tags = sym_calloc(SYM_CONF_MAX_TASK, "CB_TAGS"); if (!lp->cb_tags) { sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL"); - lp->itlq_tbl = 0; + lp->itlq_tbl = NULL; goto fail; } @@ -7545,7 +7545,7 @@ static int sym_abort_scsiio(hcb_p np, union ccb *ccb, int timed_out) /* * Look up our CCB control block. */ - cp = 0; + cp = NULL; FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { ccb_p cp2 = sym_que_entry(qp, struct sym_ccb, link_ccbq); if (cp2->cam_ccb == ccb) { @@ -8902,9 +8902,9 @@ sym_pci_attach2(pcici_t pci_tag, int unit) struct sym_pci_chip *chip; u_short command; u_char cachelnsz; - struct sym_hcb *np = 0; + struct sym_hcb *np = NULL; struct sym_nvram nvram; - struct sym_fw *fw = 0; + struct sym_fw *fw = NULL; int i; #ifdef FreeBSD_Bus_Dma_Abstraction bus_dma_tag_t bus_dmat; @@ -9412,7 +9412,7 @@ static void sym_pci_free(hcb_p np) if (np->dqueue) sym_mfree_dma(np->dqueue, sizeof(u32)*(MAX_QUEUE*2), "DQUEUE"); - while ((qp = sym_remque_head(&np->free_ccbq)) != 0) { + while ((qp = sym_remque_head(&np->free_ccbq)) != NULL) { cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); #ifdef FreeBSD_Bus_Dma_Abstraction bus_dmamap_destroy(np->data_dmat, cp->dmamap); @@ -9458,9 +9458,9 @@ static void sym_pci_free(hcb_p np) */ int sym_cam_attach(hcb_p np) { - struct cam_devq *devq = 0; - struct cam_sim *sim = 0; - struct cam_path *path = 0; + struct cam_devq *devq = NULL; + struct cam_sim *sim = NULL; + struct cam_path *path = NULL; struct ccb_setasync csa; int err; @@ -9505,7 +9505,7 @@ int sym_cam_attach(hcb_p np) if (xpt_bus_register(sim, 0) != CAM_SUCCESS) goto fail; np->sim = sim; - sim = 0; + sim = NULL; if (xpt_create_path(&path, 0, cam_sim_path(np->sim), CAM_TARGET_WILDCARD, diff --git a/sys/dev/misc/nmdm/nmdm.c b/sys/dev/misc/nmdm/nmdm.c index 7810232d4f..3442dad123 100644 --- a/sys/dev/misc/nmdm/nmdm.c +++ b/sys/dev/misc/nmdm/nmdm.c @@ -352,7 +352,7 @@ nmdmwrite(struct dev_write_args *ap) { cdev_t dev = ap->a_head.a_dev; struct uio *uio = ap->a_uio; - u_char *cp = 0; + u_char *cp = NULL; size_t cc = 0; u_char locbuf[BUFSIZ]; int cnt = 0; diff --git a/sys/dev/misc/ppc/ppc.c b/sys/dev/misc/ppc/ppc.c index 565840fab5..b81734f886 100644 --- a/sys/dev/misc/ppc/ppc.c +++ b/sys/dev/misc/ppc/ppc.c @@ -1347,9 +1347,9 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) int reg; char mask; int accum = 0; - char *ptr = 0; + char *ptr = NULL; - struct ppb_microseq *stack = 0; + struct ppb_microseq *stack = NULL; /* microsequence registers are equivalent to PC-like port registers */ @@ -1516,7 +1516,7 @@ ppc_exec_microseq(device_t dev, struct ppb_microseq **p_msq) mi = stack; /* reset the stack */ - stack = 0; + stack = NULL; /* XXX return code */ diff --git a/sys/dev/misc/pps/pps.c b/sys/dev/misc/pps/pps.c index d84583b049..a9ee5ad0af 100644 --- a/sys/dev/misc/pps/pps.c +++ b/sys/dev/misc/pps/pps.c @@ -96,7 +96,7 @@ ppsattach(device_t ppsdev) &zero, irq, RF_SHAREABLE); } /* interrupts seem mandatory */ - if (sc->intr_resource == 0) + if (sc->intr_resource == NULL) return (ENXIO); unit = device_get_unit(ppsdev); diff --git a/sys/dev/misc/puc/puc.c b/sys/dev/misc/puc/puc.c index 156ca92e7e..be623acc9c 100644 --- a/sys/dev/misc/puc/puc.c +++ b/sys/dev/misc/puc/puc.c @@ -686,7 +686,7 @@ puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, sc = (struct puc_softc *)device_get_softc(dev); for (i = 0; PUC_PORT_VALID(sc->sc_desc, i); i++) { if (sc->sc_ports[i].dev == child) { - if (sc->sc_ports[i].ihand != 0) + if (sc->sc_ports[i].ihand != NULL) return (ENXIO); sc->sc_ports[i].ihand = ihand; sc->sc_ports[i].ihandarg = arg; diff --git a/sys/dev/netif/de/if_de.c b/sys/dev/netif/de/if_de.c index 86c7b3c135..0de26617c9 100644 --- a/sys/dev/netif/de/if_de.c +++ b/sys/dev/netif/de/if_de.c @@ -4166,7 +4166,7 @@ tulip_pci_attach(device_t dev) rid = 0; res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); - if (res == 0 || bus_setup_intr(dev, res, INTR_MPSAFE, + if (res == NULL || bus_setup_intr(dev, res, INTR_MPSAFE, intr_rtn, sc, &ih, sc->tulip_if.if_serializer)) { device_printf(dev, "couldn't map interrupt\n"); diff --git a/sys/dev/netif/ed/if_ed.c b/sys/dev/netif/ed/if_ed.c index c8ede2fe35..b588257c0c 100644 --- a/sys/dev/netif/ed/if_ed.c +++ b/sys/dev/netif/ed/if_ed.c @@ -2100,7 +2100,7 @@ outloop: return; } m = ifq_dequeue(&ifp->if_snd, NULL); - if (m == 0) { + if (m == NULL) { /* * We are using the !OACTIVE flag to indicate to the outside @@ -2154,7 +2154,7 @@ outloop: break; } } - for (len = 0; m != 0; m = m->m_next) { + for (len = 0; m != NULL; m = m->m_next) { bcopy(mtod(m, caddr_t), buffer, m->m_len); buffer += m->m_len; len += m->m_len; diff --git a/sys/dev/netif/ep/if_ep.c b/sys/dev/netif/ep/if_ep.c index cfd5c31716..37afd8b117 100644 --- a/sys/dev/netif/ep/if_ep.c +++ b/sys/dev/netif/ep/if_ep.c @@ -39,7 +39,6 @@ /* * $FreeBSD: src/sys/dev/ep/if_ep.c,v 1.95.2.3 2002/03/06 07:26:35 imp Exp $ - * $DragonFly: src/sys/dev/netif/ep/if_ep.c,v 1.27 2008/05/14 11:59:19 sephe Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -477,7 +476,7 @@ startagain: outw(BASE + EP_W1_TX_PIO_WR_1, 0x0); /* Second dword meaningless */ if (EP_FTST(sc, F_ACCESS_32_BITS)) { - for (top = m; m != 0; m = m->m_next) { + for (top = m; m != NULL; m = m->m_next) { outsl(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 4); if (m->m_len & 3) @@ -486,7 +485,7 @@ startagain: m->m_len & 3); } } else { - for (top = m; m != 0; m = m->m_next) { + for (top = m; m != NULL; m = m->m_next) { outsw(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 2); if (m->m_len & 1) outb(BASE + EP_W1_TX_PIO_WR_1, diff --git a/sys/dev/netif/fe/if_fe.c b/sys/dev/netif/fe/if_fe.c index d1c1d20ca5..67441ef4da 100644 --- a/sys/dev/netif/fe/if_fe.c +++ b/sys/dev/netif/fe/if_fe.c @@ -22,7 +22,6 @@ /* * $FreeBSD: src/sys/dev/fe/if_fe.c,v 1.65.2.1 2000/09/22 10:01:47 nyan Exp $ - * $DragonFly: src/sys/dev/netif/fe/if_fe.c,v 1.30 2008/08/17 04:32:33 sephe Exp $ * * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards. * Contributed by M. Sekiguchi. @@ -1976,7 +1975,7 @@ fe_write_mbufs (struct fe_softc *sc, struct mbuf *m) if ((sc->proto_dlcr6 & FE_D6_SBW) == FE_D6_SBW_BYTE) { /* 8-bit cards are easy. */ - for (mp = m; mp != 0; mp = mp->m_next) { + for (mp = m; mp != NULL; mp = mp->m_next) { if (mp->m_len) fe_outsb(sc, FE_BMPR8, mtod(mp, caddr_t), mp->m_len); @@ -1987,7 +1986,7 @@ fe_write_mbufs (struct fe_softc *sc, struct mbuf *m) { /* 16-bit cards are a pain. */ savebyte = NO_PENDING_BYTE; - for (mp = m; mp != 0; mp = mp->m_next) { + for (mp = m; mp != NULL; mp = mp->m_next) { /* Ignore empty mbuf. */ len = mp->m_len; diff --git a/sys/dev/netif/ic/if_ic.c b/sys/dev/netif/ic/if_ic.c index b20254bc8a..c46dabf797 100644 --- a/sys/dev/netif/ic/if_ic.c +++ b/sys/dev/netif/ic/if_ic.c @@ -233,7 +233,7 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { return EAFNOSUPPORT; /* XXX */ } switch (ifr->ifr_addr.sa_family) { diff --git a/sys/dev/netif/mn/if_mn.c b/sys/dev/netif/mn/if_mn.c index 6d8b0f955b..229d978f3b 100644 --- a/sys/dev/netif/mn/if_mn.c +++ b/sys/dev/netif/mn/if_mn.c @@ -607,7 +607,7 @@ ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) mn_free_desc(dp); dp = dp2; } - sc->ch[chan]->xl->vnext = 0; + sc->ch[chan]->xl->vnext = NULL; break; } dp->data = vtophys(m2->m_data); @@ -615,7 +615,7 @@ ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) dp->flags += 1; len -= m2->m_len; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->xl->next = vtophys(dp); sc->ch[chan]->xl->vnext = dp; sc->ch[chan]->xl = dp; @@ -624,7 +624,7 @@ ngmn_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) dp->flags |= 0xc0000000; dp2->flags &= ~0x40000000; } else { - dp->m = 0; + dp->m = NULL; m2 = m2->m_next; } } @@ -690,7 +690,7 @@ ngmn_connect(hook_p hook) dp->m = m; dp->flags = 0xc0000000 + (1 << 16); dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; dp->data = vtophys(sc->name); sc->m32_mem.cs[chan].tdesc = vtophys(dp); sc->ch[chan]->x1 = dp; @@ -716,7 +716,7 @@ ngmn_connect(hook_p hook) dp->flags = 0x40000000; dp->flags += 1600 << 16; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->rl = dp; for (i = 0; i < (nts + 10); i++) { @@ -1136,13 +1136,13 @@ mn_rx_intr(struct softc *sc, u_int32_t vector) if (vtophys(dp) == sc->m32_mem.crxd[chan]) return; m = dp->m; - dp->m = 0; + dp->m = NULL; m->m_pkthdr.len = m->m_len = (dp->status >> 16) & 0x1fff; err = (dp->status >> 8) & 0xff; if (!err) { ng_queue_data(sch->hook, m, NULL); sch->last_recv = time_second; - m = 0; + m = NULL; /* we could be down by now... */ if (sch->state != UP) return; @@ -1186,7 +1186,7 @@ mn_rx_intr(struct softc *sc, u_int32_t vector) dp->flags = 0x40000000; dp->flags += 1600 << 16; dp->next = vtophys(dp); - dp->vnext = 0; + dp->vnext = NULL; sc->ch[chan]->rl->next = vtophys(dp); sc->ch[chan]->rl->vnext = dp; sc->ch[chan]->rl->flags &= ~0x40000000; diff --git a/sys/dev/netif/plip/if_plip.c b/sys/dev/netif/plip/if_plip.c index 93c4b470c3..085c17a219 100644 --- a/sys/dev/netif/plip/if_plip.c +++ b/sys/dev/netif/plip/if_plip.c @@ -206,7 +206,7 @@ lp_probe(device_t dev) /* reserve the interrupt resource, expecting irq is available to continue */ lp->res_irq = bus_alloc_legacy_irq_resource(dev, &zero, irq, RF_SHAREABLE); - if (lp->res_irq == 0) { + if (lp->res_irq == NULL) { device_printf(dev, "cannot reserve interrupt, failed.\n"); return (ENXIO); } @@ -359,7 +359,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { return EAFNOSUPPORT; /* XXX */ } switch (ifr->ifr_addr.sa_family) { diff --git a/sys/dev/raid/aac/aac.c b/sys/dev/raid/aac/aac.c index 8868af532c..cf3d345783 100644 --- a/sys/dev/raid/aac/aac.c +++ b/sys/dev/raid/aac/aac.c @@ -1309,7 +1309,7 @@ aac_bio_complete(struct aac_command *cm) /* fix up the bio based on status */ if (status == ST_OK) { bp->b_resid = 0; - code = 0; + code = NULL; } else { bp->b_error = EIO; bp->b_flags |= B_ERROR; diff --git a/sys/dev/raid/dpt/dpt_pci.c b/sys/dev/raid/dpt/dpt_pci.c index 0be36f1843..ea58b08247 100644 --- a/sys/dev/raid/dpt/dpt_pci.c +++ b/sys/dev/raid/dpt/dpt_pci.c @@ -70,8 +70,8 @@ static int dpt_pci_attach (device_t dev) { dpt_softc_t * dpt; - struct resource *io = 0; - struct resource *irq = 0; + struct resource *io = NULL; + struct resource *irq = NULL; int rid; void * ih; int error = 0; diff --git a/sys/dev/raid/hptiop/hptiop.c b/sys/dev/raid/hptiop/hptiop.c index 1266524fe8..ae5d1fa7d8 100644 --- a/sys/dev/raid/hptiop/hptiop.c +++ b/sys/dev/raid/hptiop/hptiop.c @@ -289,7 +289,7 @@ static void hptiop_request_callback_itl(struct hpt_iop_hba * hba, u_int32_t index) { struct hpt_iop_srb *srb; - struct hpt_iop_request_scsi_command *req=0; + struct hpt_iop_request_scsi_command *req=NULL; union ccb *ccb; u_int8_t *cdb; u_int32_t result, temp, dxfer; diff --git a/sys/dev/raid/hptmv/entry.c b/sys/dev/raid/hptmv/entry.c index 2a1872ce58..b3a3e89a10 100644 --- a/sys/dev/raid/hptmv/entry.c +++ b/sys/dev/raid/hptmv/entry.c @@ -134,8 +134,8 @@ static MV_BOOLEAN hptmv_event_notify(MV_SATA_ADAPTER *pMvSataAdapter, #define ccb_ccb_ptr spriv_ptr0 #define ccb_adapter ccb_h.spriv_ptr1 -IAL_ADAPTER_T *gIal_Adapter = 0; -IAL_ADAPTER_T *pCurAdapter = 0; +IAL_ADAPTER_T *gIal_Adapter = NULL; +IAL_ADAPTER_T *pCurAdapter = NULL; static MV_SATA_CHANNEL gMvSataChannels[MAX_VBUS][MV_SATA_CHANNELS_NUM]; typedef struct st_HPT_DPC { @@ -1272,7 +1272,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) pAdapter->next = 0; - if(gIal_Adapter == 0){ + if(gIal_Adapter == NULL){ gIal_Adapter = pAdapter; pCurAdapter = gIal_Adapter; } @@ -2457,7 +2457,7 @@ static void hpt_worker_thread(void) int i; pAdapter = gIal_Adapter; - while(pAdapter != 0){ + while(pAdapter != NULL){ _vbus_p = &pAdapter->VBus; diff --git a/sys/dev/raid/hptmv/gui_lib.c b/sys/dev/raid/hptmv/gui_lib.c index 3a786295b6..da1dc1f786 100644 --- a/sys/dev/raid/hptmv/gui_lib.c +++ b/sys/dev/raid/hptmv/gui_lib.c @@ -74,7 +74,7 @@ check_VDevice_valid(PVDevice p) PVBus _vbus_p; IAL_ADAPTER_T *pAdapter = gIal_Adapter; - while(pAdapter != 0) + while(pAdapter != NULL) { for (i = 0; i < MV_SATA_CHANNELS_NUM; i++) if(&(pAdapter->VDevices[i]) == p) return 0; @@ -83,7 +83,7 @@ check_VDevice_valid(PVDevice p) #ifdef SUPPORT_ARRAY pAdapter = gIal_Adapter; - while(pAdapter != 0) + while(pAdapter != NULL) { _vbus_p = &pAdapter->VBus; for (i=0;inext; @@ -448,7 +448,7 @@ int hpt_get_channel_info(int id, int bus, PCHANNEL_INFO pInfo) IAL_ADAPTER_T *pAdapTemp = gIal_Adapter; int i,iControllerCount = 0; - while(pAdapTemp != 0) + while(pAdapTemp != NULL) { if (iControllerCount++==id) goto found; diff --git a/sys/dev/raid/hptmv/hptproc.c b/sys/dev/raid/hptmv/hptproc.c index 63dfc91c1c..43793ac151 100644 --- a/sys/dev/raid/hptmv/hptproc.c +++ b/sys/dev/raid/hptmv/hptproc.c @@ -403,7 +403,7 @@ static void hpt_copy_array_info(HPT_GET_INFO *pinfo, int nld, PVDevice pArray) { int i; - char *sType=0, *sStatus=0; + char *sType=NULL, *sStatus=NULL; char buf[32]; PVDevice pTmpArray; diff --git a/sys/dev/raid/hptmv/ioctl.c b/sys/dev/raid/hptmv/ioctl.c index 0bde72e1ef..80aa9d18a8 100644 --- a/sys/dev/raid/hptmv/ioctl.c +++ b/sys/dev/raid/hptmv/ioctl.c @@ -695,7 +695,7 @@ hpt_rebuild_data_block(IAL_ADAPTER_T *pAdapter, PVDevice pArray, UCHAR flags) PCommand pCmd; UINT result; int needsync=0, retry=0, needdelete=0; - void *buffer = 0; + void *buffer = NULL; _VBUS_INST(&pAdapter->VBus) diff --git a/sys/dev/raid/vinum/vinum.c b/sys/dev/raid/vinum/vinum.c index e143748ca4..0a6f5cdda4 100644 --- a/sys/dev/raid/vinum/vinum.c +++ b/sys/dev/raid/vinum/vinum.c @@ -127,7 +127,7 @@ vinumattach(void *dummy) * read the initial configuration from. */ if ((cp = kgetenv("vinum.drives")) != NULL) { - for (cp1 = cp, i = 0, drives = 0; *cp1 != '\0'; i++) { + for (cp1 = cp, i = 0, drives = NULL; *cp1 != '\0'; i++) { cp2 = cp1; while (*cp1 != '\0' && *cp1 != ',' && *cp1 != ' ') cp1++; diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c index c9a7d87f9d..2781697810 100644 --- a/sys/dev/serial/stli/istallion.c +++ b/sys/dev/serial/stli/istallion.c @@ -2451,7 +2451,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) kprintf("STALLION: shared memory pointer=%x out of range at " "line=%d(%d), brd=%d\n", (int) offset, line, __LINE__, brdp->brdnr); - ptr = 0; + ptr = NULL; val = 0; } else { ptr = (char *) brdp->vaddr + (offset % ECP_ATPAGESIZE); @@ -2547,7 +2547,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) kprintf("STALLION: shared memory pointer=%x out of range at " "line=%d(%d), brd=%d\n", (int) offset, line, __LINE__, brdp->brdnr); - ptr = 0; + ptr = NULL; } else { ptr = (char *) brdp->vaddr + (offset % ONB_ATPAGESIZE); } @@ -2610,7 +2610,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) kprintf("STALLION: shared memory pointer=%x out of range at " "line=%d(%d), brd=%d\n", (int) offset, line, __LINE__, brdp->brdnr); - ptr = 0; + ptr = NULL; val = 0; } else { ptr = (char *) brdp->vaddr + (offset % BBY_PAGESIZE); @@ -2671,7 +2671,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) kprintf("STALLION: shared memory pointer=%x out of range at " "line=%d(%d), brd=%d\n", (int) offset, line, __LINE__, brdp->brdnr); - ptr = 0; + ptr = NULL; } else { ptr = (char *) brdp->vaddr + (offset % STAL_PAGESIZE); } diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index ff5431ac18..1156ba37dc 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -493,21 +493,21 @@ ad1816_release_resources(struct ad1816_info *ad1816, device_t dev) if (ad1816->ih) bus_teardown_intr(dev, ad1816->irq, ad1816->ih); bus_release_resource(dev, SYS_RES_IRQ, ad1816->irq_rid, ad1816->irq); - ad1816->irq = 0; + ad1816->irq = NULL; } if (ad1816->drq1) { isa_dma_release(rman_get_start(ad1816->drq1)); bus_release_resource(dev, SYS_RES_DRQ, ad1816->drq1_rid, ad1816->drq1); - ad1816->drq1 = 0; + ad1816->drq1 = NULL; } if (ad1816->drq2) { isa_dma_release(rman_get_start(ad1816->drq2)); bus_release_resource(dev, SYS_RES_DRQ, ad1816->drq2_rid, ad1816->drq2); - ad1816->drq2 = 0; + ad1816->drq2 = NULL; } if (ad1816->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, ad1816->io_rid, ad1816->io_base); - ad1816->io_base = 0; + ad1816->io_base = NULL; } if (ad1816->parent_dmat) { bus_dma_tag_destroy(ad1816->parent_dmat); diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 1d27cfc068..5867e2eaee 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -288,21 +288,21 @@ ess_release_resources(struct ess_info *sc, device_t dev) if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->drq1) { isa_dma_release(rman_get_start(sc->drq1)); bus_release_resource(dev, SYS_RES_DRQ, 0, sc->drq1); - sc->drq1 = 0; + sc->drq1 = NULL; } if (sc->drq2) { isa_dma_release(rman_get_start(sc->drq2)); bus_release_resource(dev, SYS_RES_DRQ, 1, sc->drq2); - sc->drq2 = 0; + sc->drq2 = NULL; } if (sc->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->io_base); - sc->io_base = 0; + sc->io_base = NULL; } if (sc->parent_dmat) { bus_dma_tag_destroy(sc->parent_dmat); diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index f822c94438..99a8f3392d 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -272,7 +272,7 @@ mss_release_resources(struct mss_info *mss, device_t dev) bus_teardown_intr(dev, mss->irq, mss->ih); bus_release_resource(dev, SYS_RES_IRQ, mss->irq_rid, mss->irq); - mss->irq = 0; + mss->irq = NULL; } if (mss->drq2) { if (mss->drq2 != mss->drq1) { @@ -280,28 +280,28 @@ mss_release_resources(struct mss_info *mss, device_t dev) bus_release_resource(dev, SYS_RES_DRQ, mss->drq2_rid, mss->drq2); } - mss->drq2 = 0; + mss->drq2 = NULL; } if (mss->drq1) { isa_dma_release(rman_get_start(mss->drq1)); bus_release_resource(dev, SYS_RES_DRQ, mss->drq1_rid, mss->drq1); - mss->drq1 = 0; + mss->drq1 = NULL; } if (mss->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, mss->io_rid, mss->io_base); - mss->io_base = 0; + mss->io_base = NULL; } if (mss->conf_base) { bus_release_resource(dev, SYS_RES_IOPORT, mss->conf_rid, mss->conf_base); - mss->conf_base = 0; + mss->conf_base = NULL; } if (mss->indir) { bus_release_resource(dev, SYS_RES_IOPORT, mss->indir_rid, mss->indir); - mss->indir = 0; + mss->indir = NULL; } if (mss->parent_dmat) { bus_dma_tag_destroy(mss->parent_dmat); @@ -1667,7 +1667,7 @@ ymf_test(device_t dev, struct mss_info *mss) if (!j) { bus_release_resource(dev, SYS_RES_IOPORT, mss->conf_rid, mss->conf_base); - mss->conf_base = 0; + mss->conf_base = NULL; continue; } version = conf_rd(mss, OPL3SAx_MISC) & 0x07; diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 7eccfcc2b7..15ae09e9dc 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -435,23 +435,23 @@ sb16_release_resources(struct sb_info *sb, device_t dev) if (sb->ih) bus_teardown_intr(dev, sb->irq, sb->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sb->irq); - sb->irq = 0; + sb->irq = NULL; } if (sb->drq2) { if (sb->drq2 != sb->drq1) { isa_dma_release(rman_get_start(sb->drq2)); bus_release_resource(dev, SYS_RES_DRQ, 1, sb->drq2); } - sb->drq2 = 0; + sb->drq2 = NULL; } if (sb->drq1) { isa_dma_release(rman_get_start(sb->drq1)); bus_release_resource(dev, SYS_RES_DRQ, 0, sb->drq1); - sb->drq1 = 0; + sb->drq1 = NULL; } if (sb->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sb->io_base); - sb->io_base = 0; + sb->io_base = NULL; } if (sb->parent_dmat) { bus_dma_tag_destroy(sb->parent_dmat); diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index d392cfdb30..9700776561 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -263,16 +263,16 @@ sb_release_resources(struct sb_info *sb, device_t dev) if (sb->ih) bus_teardown_intr(dev, sb->irq, sb->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sb->irq); - sb->irq = 0; + sb->irq = NULL; } if (sb->drq) { isa_dma_release(rman_get_start(sb->drq)); bus_release_resource(dev, SYS_RES_DRQ, 0, sb->drq); - sb->drq = 0; + sb->drq = NULL; } if (sb->io_base) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sb->io_base); - sb->io_base = 0; + sb->io_base = NULL; } if (sb->parent_dmat) { bus_dma_tag_destroy(sb->parent_dmat); diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index 9b2fe11066..847fe4d215 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -725,15 +725,15 @@ als_resource_free(device_t dev, struct sc_info *sc) { if (sc->reg) { bus_release_resource(dev, SYS_RES_IOPORT, sc->regid, sc->reg); - sc->reg = 0; + sc->reg = NULL; } if (sc->ih) { bus_teardown_intr(dev, sc->irq, sc->ih); - sc->ih = 0; + sc->ih = NULL; } if (sc->irq) { bus_release_resource(dev, SYS_RES_IRQ, sc->irqid, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->parent_dmat) { bus_dma_tag_destroy(sc->parent_dmat); @@ -751,7 +751,7 @@ als_resource_grab(device_t dev, struct sc_info *sc) sc->regid = PCIR_BAR(0); sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid, 0, ~0, ALS_CONFIG_SPACE_BYTES, RF_ACTIVE); - if (sc->reg == 0) { + if (sc->reg == NULL) { device_printf(dev, "unable to allocate register space\n"); goto bad; } @@ -760,7 +760,7 @@ als_resource_grab(device_t dev, struct sc_info *sc) sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irqid, RF_ACTIVE | RF_SHAREABLE); - if (sc->irq == 0) { + if (sc->irq == NULL) { device_printf(dev, "unable to allocate interrupt\n"); goto bad; } diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c index f1c16fbf48..86e9e0e12a 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -555,8 +555,8 @@ au_pci_attach(device_t dev) struct resource *reg[10]; int i, j, mapped = 0; int irqid; - struct resource *irq = 0; - void *ih = 0; + struct resource *irq = NULL; + void *ih = NULL; struct ac97_info *codec; char status[SND_STATUSLEN]; diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index 2c1ecb9bc2..6d2b2a354f 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -571,7 +571,7 @@ static int fm801_pci_attach(device_t dev) { u_int32_t data; - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; struct fm801_info *fm801; int i; int mapped = 0; diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index c1259b652f..c8c372310b 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -666,7 +666,7 @@ nm_pci_attach(device_t dev) { u_int32_t data; struct sc_info *sc; - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; char status[SND_STATUSLEN]; sc = kmalloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index de4d238dba..907611b22c 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -832,31 +832,31 @@ ess_release_resources(struct ess_info *sc, device_t dev) if (sc->ih) bus_teardown_intr(dev, sc->irq, sc->ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); - sc->irq = 0; + sc->irq = NULL; } if (sc->io) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->io); - sc->io = 0; + sc->io = NULL; } if (sc->sb) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(1), sc->sb); - sc->sb = 0; + sc->sb = NULL; } if (sc->vc) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(2), sc->vc); - sc->vc = 0; + sc->vc = NULL; } if (sc->mpu) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(3), sc->mpu); - sc->mpu = 0; + sc->mpu = NULL; } if (sc->gp) { bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(4), sc->gp); - sc->gp = 0; + sc->gp = NULL; } if (sc->parent_dmat) { diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index 312983c673..e0af9f5cd5 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -812,7 +812,7 @@ tr_pci_attach(device_t dev) { u_int32_t data; struct tr_info *tr; - struct ac97_info *codec = 0; + struct ac97_info *codec = NULL; int i, dacn; char status[SND_STATUSLEN]; diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 540ebdd0b5..2569a24bee 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -869,7 +869,7 @@ via_chip_init(device_t dev) static int via_attach(device_t dev) { - struct via_info *via = 0; + struct via_info *via = NULL; char status[SND_STATUSLEN]; int i, via_dxs_disabled, via_dxs_src, via_dxs_chnum, via_sgd_chnum; uint32_t revid; @@ -1059,7 +1059,7 @@ static int via_detach(device_t dev) { int r; - struct via_info *via = 0; + struct via_info *via = NULL; r = pcm_unregister(dev); if (r) return r; diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index c18ceafb55..337a280d42 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -475,7 +475,7 @@ dma_cb(void *p, bus_dma_segment_t *bds, int a, int b) static int via_attach(device_t dev) { - struct via_info *via = 0; + struct via_info *via = NULL; char status[SND_STATUSLEN]; u_int32_t data, cnt; @@ -617,7 +617,7 @@ static int via_detach(device_t dev) { int r; - struct via_info *via = 0; + struct via_info *via = NULL; r = pcm_unregister(dev); if (r) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 77dfd62231..3d0751f499 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -596,7 +596,7 @@ uaudio_get_cluster(int id, const struct io_terminal *iot) for (i = 0; i < 25; i++) { /* avoid infinite loops */ dp = iot[id].d.desc; - if (dp == 0) + if (dp == NULL) goto bad; switch (dp->bDescriptorSubtype) { case UDESCSUB_AC_INPUT: @@ -2092,7 +2092,7 @@ uaudio_chan_alloc_buffers(struct uaudio_softc *sc, struct chan *ch) goto bad; ch->chanbufs[i].xfer = xfer; buf = usbd_alloc_buffer(xfer, size); - if (buf == 0) { + if (buf == NULL) { i++; goto bad; } diff --git a/sys/dev/usbmisc/ugen/ugen.c b/sys/dev/usbmisc/ugen/ugen.c index 5729f1d87d..c813d388aa 100644 --- a/sys/dev/usbmisc/ugen/ugen.c +++ b/sys/dev/usbmisc/ugen/ugen.c @@ -431,7 +431,7 @@ ugenopen(struct dev_open_args *ap) for (dir = OUT; dir <= IN; dir++) { if (ap->a_oflags & (dir == OUT ? FWRITE : FREAD)) { sce = &sc->sc_endpoints[endpt][dir]; - if (sce == 0 || sce->edesc == 0) + if (sce == NULL || sce->edesc == NULL) return (ENXIO); } } @@ -509,7 +509,7 @@ ugenopen(struct dev_open_args *ap) sce->isoreqs[i].xfer = xfer; buf = usbd_alloc_buffer (xfer, isize * UGEN_NISORFRMS); - if (buf == 0) { + if (buf == NULL) { i++; goto bad; } @@ -1061,8 +1061,8 @@ ugen_set_interface(struct ugen_softc *sc, int ifaceidx, int altno) endpt = ed->bEndpointAddress; dir = UE_GET_DIR(endpt) == UE_DIR_IN ? IN : OUT; sce = &sc->sc_endpoints[UE_GET_ADDR(endpt)][dir]; - sce->sc = 0; - sce->edesc = 0; + sce->sc = NULL; + sce->edesc = NULL; sce->iface = 0; } @@ -1338,7 +1338,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, int len = UGETW(ur->ucr_request.wLength); struct iovec iov; struct uio uio; - void *ptr = 0; + void *ptr = NULL; usbd_status err; int error = 0; diff --git a/sys/dev/usbmisc/uhid/uhid.c b/sys/dev/usbmisc/uhid/uhid.c index 0b84476b25..16418492fb 100644 --- a/sys/dev/usbmisc/uhid/uhid.c +++ b/sys/dev/usbmisc/uhid/uhid.c @@ -382,7 +382,7 @@ uhidopen(struct dev_open_args *ap) sc->sc_state &= ~UHID_IMMED; - sc->sc_async = 0; + sc->sc_async = NULL; return (0); } @@ -411,7 +411,7 @@ uhidclose(struct dev_close_args *ap) sc->sc_state &= ~UHID_OPEN; - sc->sc_async = 0; + sc->sc_async = NULL; return (0); } diff --git a/sys/dev/usbmisc/urio/urio.c b/sys/dev/usbmisc/urio/urio.c index b68f10817e..22fccc6f14 100644 --- a/sys/dev/usbmisc/urio/urio.c +++ b/sys/dev/usbmisc/urio/urio.c @@ -459,7 +459,7 @@ urioioctl(struct dev_ioctl_args *ap) struct uio uio; usb_device_request_t req; int req_flags = 0, req_actlen = 0; - void *ptr = 0; + void *ptr = NULL; int error = 0; usbd_status r; diff --git a/sys/dev/usbmisc/uscanner/uscanner.c b/sys/dev/usbmisc/uscanner/uscanner.c index c4c8f60416..593f80f356 100644 --- a/sys/dev/usbmisc/uscanner/uscanner.c +++ b/sys/dev/usbmisc/uscanner/uscanner.c @@ -308,7 +308,7 @@ uscanner_attach(device_t self) { struct uscanner_softc *sc = device_get_softc(self); struct usb_attach_arg *uaa = device_get_ivars(self); - usb_interface_descriptor_t *id = 0; + usb_interface_descriptor_t *id = NULL; usb_endpoint_descriptor_t *ed, *ed_bulkin = NULL, *ed_bulkout = NULL; int i; usbd_status err; @@ -330,7 +330,7 @@ uscanner_attach(device_t self) err = usbd_device2interface_handle(sc->sc_udev, 0, &sc->sc_iface); if (!err && sc->sc_iface) id = usbd_get_interface_descriptor(sc->sc_iface); - if (err || id == 0) { + if (err || id == NULL) { kprintf("%s: could not get interface descriptor, err=%d,id=%p\n", device_get_nameunit(sc->sc_dev), err, id); return ENXIO; @@ -339,7 +339,7 @@ uscanner_attach(device_t self) /* Find the two first bulk endpoints */ for (i = 0 ; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i); - if (ed == 0) { + if (ed == NULL) { kprintf("%s: could not read endpoint descriptor\n", device_get_nameunit(sc->sc_dev)); return ENXIO; diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index 73dc1e6096..523a06343c 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c @@ -447,7 +447,7 @@ linprocfs_getattr(struct vop_getattr_args *ap) default: procp = PFIND(pfs->pfs_pid); - if (procp == 0 || procp->p_ucred == NULL) + if (procp == NULL || procp->p_ucred == NULL) return (ENOENT); } @@ -826,7 +826,7 @@ linprocfs_lookup(struct vop_old_lookup_args *ap) break; p = PFIND(pid); - if (p == 0) + if (p == NULL) break; if (!PRISON_CHECK(ap->a_cnp->cn_cred, p->p_ucred)) @@ -846,7 +846,7 @@ linprocfs_lookup(struct vop_old_lookup_args *ap) } p = PFIND(pfs->pfs_pid); - if (p == 0) + if (p == NULL) break; if (!PRISON_CHECK(ap->a_cnp->cn_cred, p->p_ucred)) diff --git a/sys/gnu/vfs/ext2fs/ext2_vfsops.c b/sys/gnu/vfs/ext2fs/ext2_vfsops.c index 54a67f3885..5b264de1ce 100644 --- a/sys/gnu/vfs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/vfs/ext2fs/ext2_vfsops.c @@ -275,7 +275,7 @@ ext2_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) { struct vnode *devvp; struct ext2_args args; - struct ext2mount *ump = 0; + struct ext2mount *ump = NULL; struct ext2_sb_info *fs; size_t size; int error, flags; diff --git a/sys/kern/kern_p1003_1b.c b/sys/kern/kern_p1003_1b.c index 75d80141b2..7d99640400 100644 --- a/sys/kern/kern_p1003_1b.c +++ b/sys/kern/kern_p1003_1b.c @@ -30,7 +30,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/posix4/p1003_1b.c,v 1.5.2.2 2003/03/25 06:13:35 rwatson Exp $ - * $DragonFly: src/sys/kern/kern_p1003_1b.c,v 1.10 2007/06/26 19:31:08 dillon Exp $ */ /* p1003_1b: Real Time common code. @@ -88,7 +87,7 @@ MALLOC_DEFINE(M_P31B, "p1003.1b", "Posix 1003.1B"); int p31b_proc(struct proc *p, pid_t pid, struct proc **pp) { int ret = 0; - struct proc *other_proc = 0; + struct proc *other_proc = NULL; if (pid == 0) { other_proc = p; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 233dbe2aae..c63a9bcb37 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -574,7 +574,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) name++; continue; } - lsp2 = 0; + lsp2 = NULL; SLIST_FOREACH(oid, lsp, oid_link) { if (oid->oid_number != *name) continue; @@ -766,7 +766,7 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) { char *p; int error, oid[CTL_MAXNAME], len; - struct sysctl_oid *op = 0; + struct sysctl_oid *op = NULL; if (!req->newlen) return ENOENT; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 271abcc3b3..964253fba3 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -748,7 +748,7 @@ sys_setitimer(struct setitimer_args *uap) if ((uap->itv = uap->oitv) && (error = sys_getitimer((struct getitimer_args *)uap))) return (error); - if (itvp == 0) + if (itvp == NULL) return (0); if (itimerfix(&aitv.it_value)) return (EINVAL); diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 879a9732e7..6a480f8c93 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/link_elf.c,v 1.24 1999/12/24 15:33:36 bde Exp $ - * $DragonFly: src/sys/kern/link_elf.c,v 1.29 2008/08/01 23:11:16 dillon Exp $ */ #include @@ -968,7 +967,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value, u_long diff = off; u_long st_value; const Elf_Sym *es; - const Elf_Sym *best = 0; + const Elf_Sym *best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -986,7 +985,7 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value, } } } - if (best == 0) + if (best == NULL) *diffp = off; else *diffp = diff; diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 380d52f798..b7bd1db28d 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -489,7 +489,7 @@ link_elf_obj_load_file(const char *filename, linker_file_t * result) goto out; } ef->nprogtab = 0; - ef->e_shdr = 0; + ef->e_shdr = NULL; ef->nreltab = 0; ef->nrelatab = 0; @@ -1069,7 +1069,7 @@ link_elf_obj_search_symbol(linker_file_t lf, caddr_t value, u_long diff = off; u_long st_value; const Elf_Sym *es; - const Elf_Sym *best = 0; + const Elf_Sym *best = NULL; int i; for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) { @@ -1087,7 +1087,7 @@ link_elf_obj_search_symbol(linker_file_t lf, caddr_t value, } } } - if (best == 0) + if (best == NULL) *diffp = off; else *diffp = diff; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index b9c3fdf562..895777fd41 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2248,7 +2248,7 @@ resource_list_alloc(struct resource_list *rl, u_long start, u_long end, u_long count, u_int flags, int cpuid) { - struct resource_list_entry *rle = 0; + struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); int isdefault = (start == 0UL && end == ~0UL); @@ -2294,7 +2294,7 @@ resource_list_release(struct resource_list *rl, device_t bus, device_t child, int type, int rid, struct resource *res) { - struct resource_list_entry *rle = 0; + struct resource_list_entry *rle = NULL; int passthrough = (device_get_parent(child) != bus); int error; diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index 0e72a90b8e..9e3b7a1052 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -115,7 +115,7 @@ kmstartup(void *dummy) p->tossize = p->tolimit * sizeof(struct tostruct); cp = (char *)kmalloc(p->kcountsize + p->fromssize + p->tossize, M_GPROF, M_NOWAIT | M_ZERO); - if (cp == 0) { + if (cp == NULL) { kprintf("No memory for profiling.\n"); return; } diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 903e9334e8..f3ff1d9942 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_rman.c,v 1.10.2.1 2001/06/05 08:06:08 imp Exp $ - * $DragonFly: src/sys/kern/subr_rman.c,v 1.15 2008/09/30 12:20:29 hasso Exp $ */ /* @@ -125,7 +124,7 @@ rman_manage_region(struct rman *rm, u_long start, u_long end) DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n", rm->rm_descr, start, end)); r = kmalloc(sizeof *r, M_RMAN, M_NOWAIT | M_ZERO); - if (r == 0) + if (r == NULL) return ENOMEM; r->r_sharehead = 0; r->r_start = start; @@ -190,7 +189,7 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, struct resource *r, *s, *rv; u_long rstart, rend; - rv = 0; + rv = NULL; DPRINTF(("rman_reserve_resource: <%s> request: [%#lx, %#lx], length " "%#lx, flags %u, device %s\n", rm->rm_descr, start, end, @@ -254,7 +253,7 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, * two new allocations; the second requires but one. */ rv = kmalloc(sizeof *rv, M_RMAN, M_NOWAIT | M_ZERO); - if (rv == 0) + if (rv == NULL) goto out; rv->r_start = rstart; rv->r_end = rstart + count - 1; @@ -274,9 +273,9 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, */ r = kmalloc(sizeof *r, M_RMAN, M_NOWAIT | M_ZERO); - if (r == 0) { + if (r == NULL) { kfree(rv, M_RMAN); - rv = 0; + rv = NULL; goto out; } r->r_start = rv->r_end + 1; @@ -332,7 +331,7 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, if (s->r_start >= start && s->r_end <= end && (s->r_end - s->r_start + 1) == count) { rv = kmalloc(sizeof *rv, M_RMAN, M_NOWAIT | M_ZERO); - if (rv == 0) + if (rv == NULL) goto out; rv->r_start = s->r_start; rv->r_end = s->r_end; @@ -346,7 +345,7 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, M_NOWAIT | M_ZERO); if (s->r_sharehead == 0) { kfree(rv, M_RMAN); - rv = 0; + rv = NULL; goto out; } LIST_INIT(s->r_sharehead); @@ -375,7 +374,7 @@ out: struct resource *whohas; if (int_rman_activate_resource(rm, rv, &whohas)) { int_rman_release_resource(rm, rv); - rv = 0; + rv = NULL; } } lwkt_reltoken(rm->rm_slock); diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index b5e503c33c..8200e8b54f 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -961,7 +961,7 @@ ptcwrite(struct dev_write_args *ap) { cdev_t dev = ap->a_head.a_dev; struct tty *tp = dev->si_tty; - u_char *cp = 0; + u_char *cp = NULL; int cc = 0; u_char locbuf[BUFSIZ]; int cnt = 0; diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index a6df6c9bcb..3fce5b20a6 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/tty_subr.c,v 1.32 1999/08/28 00:46:21 peter Exp $ - * $DragonFly: src/sys/kern/tty_subr.c,v 1.10 2006/12/23 00:35:04 swildner Exp $ */ /* @@ -63,7 +62,7 @@ static void clist_init (void *); SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FIRST, clist_init, NULL) -static struct cblock *cfreelist = 0; +static struct cblock *cfreelist = NULL; int cfreecount = 0; static int cslushcount; static int ctotcount; @@ -660,7 +659,7 @@ nextc(struct clist *clistp, char *cp, int *dst) int clist_unputc(struct clist *clistp) { - struct cblock *cblockp = 0, *cbp = 0; + struct cblock *cblockp = NULL, *cbp = NULL; int chr = -1; crit_enter(); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f427b60cf8..1bd2c41f13 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -192,7 +192,7 @@ socreate(int dom, struct socket **aso, int type, else prp = pffindtype(dom, type); - if (prp == 0 || prp->pr_usrreqs->pru_attach == 0) + if (prp == NULL || prp->pr_usrreqs->pru_attach == 0) return (EPROTONOSUPPORT); if (p->p_ucred->cr_prison && jail_socket_unixiproute_only && @@ -205,7 +205,7 @@ socreate(int dom, struct socket **aso, int type, if (prp->pr_type != type) return (EPROTOTYPE); - so = soalloc(p != 0); + so = soalloc(p != NULL); if (so == NULL) return (ENOBUFS); @@ -762,7 +762,7 @@ restart: if ((so->so_state & SS_ISCONFIRMING) == 0 && !(resid == 0 && clen != 0)) gotoerr(ENOTCONN); - } else if (addr == 0) + } else if (addr == NULL) gotoerr(so->so_proto->pr_flags & PR_CONNREQUIRED ? ENOTCONN : EDESTADDRREQ); } @@ -808,7 +808,7 @@ restart: * For datagram protocols, leave room * for protocol headers in first mbuf. */ - if (atomic && top == 0 && len < mlen) + if (atomic && top == NULL && len < mlen) MH_ALIGN(m, len); } space -= len; @@ -858,7 +858,7 @@ restart: if (dontroute) so->so_options &= ~SO_DONTROUTE; clen = 0; - control = 0; + control = NULL; top = NULL; mp = ⊤ if (error) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 19a526b8db..ac681e7531 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -32,7 +32,6 @@ * * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.54.2.10 2003/03/04 17:28:09 nectar Exp $ - * $DragonFly: src/sys/kern/uipc_usrreq.c,v 1.44 2008/09/06 05:44:58 dillon Exp $ */ #include @@ -1216,7 +1215,7 @@ unp_externalize(struct mbuf *rights) * zero the pointer before calling unp_discard, * since it may end up in unp_gc().. */ - *rp++ = 0; + *rp++ = NULL; unp_discard(fp, NULL); } lwkt_reltoken(&unp_token); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6e68c46f0c..19ec8126cb 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3197,7 +3197,7 @@ geteblk(int size) maxsize = (size + BKVAMASK) & ~BKVAMASK; - while ((bp = getnewbuf(0, 0, size, maxsize)) == 0) + while ((bp = getnewbuf(0, 0, size, maxsize)) == NULL) ; allocbuf(bp, size); bp->b_flags |= B_INVAL; /* b_dep cleared by getnewbuf() */ diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2ea0f3827c..40fcd92392 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1911,7 +1911,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, struct radix_node_head *rnh; int i; struct radix_node *rn; - struct sockaddr *saddr, *smask = 0; + struct sockaddr *saddr, *smask = NULL; struct domain *dom; int error; @@ -1947,7 +1947,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, smask->sa_len = argp->ex_masklen; } i = saddr->sa_family; - if ((rnh = nep->ne_rtable[i]) == 0) { + if ((rnh = nep->ne_rtable[i]) == NULL) { /* * Seems silly to initialize every AF when most are not used, * do so on demand here @@ -1958,14 +1958,14 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, dom->dom_rtoffset); break; } - if ((rnh = nep->ne_rtable[i]) == 0) { + if ((rnh = nep->ne_rtable[i]) == NULL) { error = ENOBUFS; goto out; } } rn = (*rnh->rnh_addaddr) ((char *) saddr, (char *) smask, rnh, np->netc_rnodes); - if (rn == 0 || np != (struct netcred *) rn) { /* already exists */ + if (rn == NULL || np != (struct netcred *) rn) { /* already exists */ error = EPERM; goto out; } diff --git a/sys/libkern/strtol.c b/sys/libkern/strtol.c index 45bc59886b..a6478b762f 100644 --- a/sys/libkern/strtol.c +++ b/sys/libkern/strtol.c @@ -36,7 +36,6 @@ * From: static char sccsid[] = "@(#)strtol.c 8.1 (Berkeley) 6/4/93"; * * $FreeBSD: src/sys/libkern/strtol.c,v 1.5 1999/12/01 22:56:50 archie Exp $ - * $DragonFly: src/sys/libkern/strtol.c,v 1.3 2004/01/26 11:09:44 joerg Exp $ */ #include @@ -124,7 +123,7 @@ strtol(const char *nptr, char **endptr, int base) acc = neg ? LONG_MIN : LONG_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } diff --git a/sys/libkern/strtoq.c b/sys/libkern/strtoq.c index bd3bfdfe0d..ae48cfd219 100644 --- a/sys/libkern/strtoq.c +++ b/sys/libkern/strtoq.c @@ -34,7 +34,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/libkern/strtoq.c,v 1.3 1999/12/01 22:56:51 archie Exp $ - * $DragonFly: src/sys/libkern/strtoq.c,v 1.2 2003/06/17 04:28:42 dillon Exp $ */ #include @@ -128,7 +127,7 @@ strtoq(const char *nptr, char **endptr, int base) acc = neg ? QUAD_MIN : QUAD_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } diff --git a/sys/libkern/strtoul.c b/sys/libkern/strtoul.c index 5963a68167..404dedf59e 100644 --- a/sys/libkern/strtoul.c +++ b/sys/libkern/strtoul.c @@ -36,7 +36,6 @@ * From: static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; * * $FreeBSD: src/sys/libkern/strtoul.c,v 1.3 1999/12/01 22:56:51 archie Exp $ - * $DragonFly: src/sys/libkern/strtoul.c,v 1.3 2004/01/26 11:09:44 joerg Exp $ */ #include @@ -103,7 +102,7 @@ strtoul(const char *nptr, char **endptr, int base) acc = ULONG_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } diff --git a/sys/libkern/strtouq.c b/sys/libkern/strtouq.c index 789d4f0c31..f56cea59a4 100644 --- a/sys/libkern/strtouq.c +++ b/sys/libkern/strtouq.c @@ -34,7 +34,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/libkern/strtouq.c,v 1.3 1999/12/01 22:56:51 archie Exp $ - * $DragonFly: src/sys/libkern/strtouq.c,v 1.2 2003/06/17 04:28:42 dillon Exp $ */ #include @@ -106,7 +105,7 @@ strtouq(const char *nptr, char **endptr, int base) acc = UQUAD_MAX; } else if (neg) acc = -acc; - if (endptr != 0) + if (endptr != NULL) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index ced32b2d5e..fc5668a27b 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -38,7 +38,6 @@ * @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 * * $FreeBSD: src/sys/net/bpf_filter.c,v 1.17 1999/12/29 04:38:31 peter Exp $ - * $DragonFly: src/sys/net/bpf_filter.c,v 1.10 2008/01/02 12:30:34 sephe Exp $ */ #include @@ -97,7 +96,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err) while (k >= len) { k -= len; m = m->m_next; - if (m == 0) + if (m == NULL) goto bad; len = m->m_len; } @@ -107,7 +106,7 @@ m_xword(struct mbuf *m, bpf_u_int32 k, int *err) return EXTRACT_LONG(cp); } m0 = m->m_next; - if (m0 == 0 || m0->m_len + len - k < 4) + if (m0 == NULL || m0->m_len + len - k < 4) goto bad; *err = 0; np = mtod(m0, u_char *); @@ -150,7 +149,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err) while (k >= len) { k -= len; m = m->m_next; - if (m == 0) + if (m == NULL) goto bad; len = m->m_len; } @@ -160,7 +159,7 @@ m_xhalf(struct mbuf *m, bpf_u_int32 k, int *err) return EXTRACT_SHORT(cp); } m0 = m->m_next; - if (m0 == 0) + if (m0 == NULL) goto bad; *err = 0; return (cp[0] << 8) | mtod(m0, u_char *)[0]; @@ -184,7 +183,7 @@ bpf_filter(const struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen) bzero(mem, sizeof(mem)); - if (pc == 0) { + if (pc == NULL) { /* * No filter means accept all. */ diff --git a/sys/net/bridge/if_bridge.c b/sys/net/bridge/if_bridge.c index 553a932d7a..3219259646 100644 --- a/sys/net/bridge/if_bridge.c +++ b/sys/net/bridge/if_bridge.c @@ -2989,7 +2989,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, return; } - alt_if = 0; + alt_if = NULL; alt_priority = 0; found = 0; used = 0; @@ -3974,7 +3974,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) if (hlen < sizeof(struct ip)) goto bad; if (hlen > (*mp)->m_len) { - if ((*mp = m_pullup(*mp, hlen)) == 0) + if ((*mp = m_pullup(*mp, hlen)) == NULL) goto bad; ip = mtod(*mp, struct ip *); if (ip == NULL) @@ -4099,7 +4099,7 @@ bridge_ip_checkbasic(struct mbuf **mp) goto bad; } if (hlen > m->m_len) { - if ((m = m_pullup(m, hlen)) == 0) { + if ((m = m_pullup(m, hlen)) == NULL) { ipstat.ips_badhlen++; goto bad; } diff --git a/sys/net/disc/if_disc.c b/sys/net/disc/if_disc.c index 040b88f91c..c1834648ce 100644 --- a/sys/net/disc/if_disc.c +++ b/sys/net/disc/if_disc.c @@ -32,7 +32,6 @@ * * From: @(#)if_loop.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_disc.c,v 1.26.2.2 2001/12/20 10:30:16 ru Exp $ - * $DragonFly: src/sys/net/disc/if_disc.c,v 1.10 2006/12/22 23:44:55 swildner Exp $ */ /* @@ -167,7 +166,7 @@ discioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCSIFADDR: ifp->if_flags |= IFF_UP; ifa = (struct ifaddr *)data; - if (ifa != 0) + if (ifa != NULL) ifa->ifa_rtrequest = discrtrequest; /* * Everything else is done at a higher level. @@ -176,7 +175,7 @@ discioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { error = EAFNOSUPPORT; /* XXX */ break; } diff --git a/sys/net/ef/if_ef.c b/sys/net/ef/if_ef.c index 42f6d0eda9..8893645d46 100644 --- a/sys/net/ef/if_ef.c +++ b/sys/net/ef/if_ef.c @@ -203,7 +203,7 @@ ef_start(struct ifnet *ifp) EFDEBUG("\n"); for (;;) { IF_DEQUEUE(&ifp->if_snd, m); - if (m == 0) + if (m == NULL) break; BPF_MTAP(ifp, m); if (IF_QFULL(&p->if_snd)) { diff --git a/sys/net/faith/if_faith.c b/sys/net/faith/if_faith.c index 8b5982d41e..518ee8b1fe 100644 --- a/sys/net/faith/if_faith.c +++ b/sys/net/faith/if_faith.c @@ -33,7 +33,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_faith.c,v 1.3.2.6 2002/04/28 05:40:25 suz Exp $ - * $DragonFly: src/sys/net/faith/if_faith.c,v 1.18 2008/01/11 11:59:40 sephe Exp $ */ /* * derived from @@ -294,7 +293,7 @@ faithioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { error = EAFNOSUPPORT; /* XXX */ break; } diff --git a/sys/net/gre/if_gre.c b/sys/net/gre/if_gre.c index 9358df648d..a91af3618e 100644 --- a/sys/net/gre/if_gre.c +++ b/sys/net/gre/if_gre.c @@ -456,7 +456,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCDELMULTI: if ((error = priv_check_cred(cr, PRIV_ROOT, NULL_CRED_OKAY)) != 0) break; - if (ifr == 0) { + if (ifr == NULL) { error = EAFNOSUPPORT; break; } diff --git a/sys/net/i4b/capi/iavc/iavc_isa.c b/sys/net/i4b/capi/iavc/iavc_isa.c index 86823e8529..3155a7d5e1 100644 --- a/sys/net/i4b/capi/iavc/iavc_isa.c +++ b/sys/net/i4b/capi/iavc/iavc_isa.c @@ -180,7 +180,7 @@ static int iavc_isa_attach(device_t dev) { struct iavc_softc *sc; - void *ih = 0; + void *ih = NULL; int unit = device_get_unit(dev); int irq; int error; diff --git a/sys/net/i4b/capi/iavc/iavc_lli.c b/sys/net/i4b/capi/iavc/iavc_lli.c index e87fd56ab6..988dc92b69 100644 --- a/sys/net/i4b/capi/iavc/iavc_lli.c +++ b/sys/net/i4b/capi/iavc/iavc_lli.c @@ -26,7 +26,6 @@ * The AVM ISDN controllers' Low Level Interface. * * $FreeBSD: src/sys/i4b/capi/iavc/iavc_lli.c,v 1.2.2.1 2001/08/10 14:08:34 obrien Exp $ - * $DragonFly: src/sys/net/i4b/capi/iavc/iavc_lli.c,v 1.10 2006/12/22 23:44:55 swildner Exp $ */ #include @@ -661,7 +660,7 @@ iavc_handle_intr(iavc_softc_t *sc) static void iavc_handle_rx(iavc_softc_t *sc) { - u_int8_t *dmabuf = 0, cmd; + u_int8_t *dmabuf = NULL, cmd; if (sc->sc_dma) { dmabuf = amcc_get_byte(&sc->sc_recvbuf[4], &cmd); diff --git a/sys/net/i4b/capi/iavc/iavc_pci.c b/sys/net/i4b/capi/iavc/iavc_pci.c index 6016063c3c..5a99932126 100644 --- a/sys/net/i4b/capi/iavc/iavc_pci.c +++ b/sys/net/i4b/capi/iavc/iavc_pci.c @@ -119,7 +119,7 @@ static int iavc_pci_attach(device_t dev) { struct iavc_softc *sc; - void *ih = 0; + void *ih = NULL; u_int16_t did = pci_get_device(dev); int unit = device_get_unit(dev), ret; int error; diff --git a/sys/net/i4b/driver/i4b_tel.c b/sys/net/i4b/driver/i4b_tel.c index 54804f54dd..fc1ea41f90 100644 --- a/sys/net/i4b/driver/i4b_tel.c +++ b/sys/net/i4b/driver/i4b_tel.c @@ -180,8 +180,8 @@ i4btelattach(void *dummy) { tel_sc[i][j].devstate = ST_IDLE; tel_sc[i][j].audiofmt = CVT_NONE; - tel_sc[i][j].rcvttab = 0; - tel_sc[i][j].wcvttab = 0; + tel_sc[i][j].rcvttab = NULL; + tel_sc[i][j].wcvttab = NULL; tel_sc[i][j].result = 0; switch(j) @@ -302,8 +302,8 @@ i4btelioctl(struct dev_ioctl_args *ap) switch (*(int *)ap->a_data) { case CVT_NONE: - sc->rcvttab = 0; - sc->wcvttab = 0; + sc->rcvttab = NULL; + sc->wcvttab = NULL; break; case CVT_ALAW2ULAW: /* ISDN: a-law */ diff --git a/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c index f3c508a071..10dc1e98cd 100644 --- a/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c +++ b/sys/net/i4b/layer1/ifpi/i4b_ifpi_pci.c @@ -488,7 +488,7 @@ avma1pp_attach_avma1pp(device_t dev) u_int v; int unit, error = 0; u_int16_t did, vid; - void *ih = 0; + void *ih = NULL; bus_space_handle_t bhandle; bus_space_tag_t btag; diff --git a/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c b/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c index c87f32ec11..fc51352a2b 100644 --- a/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c +++ b/sys/net/i4b/layer1/ifpi2/i4b_ifpi2_pci.c @@ -444,7 +444,7 @@ avma1pp2_attach_avma1pp(device_t dev) u_int v; int unit, error = 0; u_int16_t did, vid; - void *ih = 0; + void *ih = NULL; bus_space_handle_t bhandle; bus_space_tag_t btag; diff --git a/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c b/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c index 76178a89f4..c70d7a8e64 100644 --- a/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c +++ b/sys/net/i4b/layer1/ifpnp/i4b_ifpnp_avm.c @@ -457,7 +457,7 @@ avm_pnp_attach(device_t dev) u_int v; int unit, error = 0; u_int16_t vid; - void *ih = 0; + void *ih = NULL; bus_space_handle_t bhandle; bus_space_tag_t btag; diff --git a/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c b/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c index 0350e75a44..dc4366f5e7 100644 --- a/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c +++ b/sys/net/i4b/layer1/ihfc/i4b_ihfc_pnp.c @@ -147,7 +147,7 @@ ihfc_pnp_probe(device_t dev) ihfc_id_t *ids = &ihfc_pnp_ids[0]; /* ids ptr */ ihfc_sc_t *sc = &ihfc_softc[unit]; /* softc */ u_char flag = 0; /* flag */ - void *dummy = 0; /* a dummy */ + void *dummy = NULL; /* a dummy */ HFC_VAR; @@ -247,7 +247,7 @@ ihfc_isa_probe(device_t dev) const u_char *irq = &IRQ0[0]; /* irq's to try */ const u_long *iobase = &IO0[0]; /* iobases to try */ u_char flag = 0; /* flag */ - void *dummy = 0; /* a dummy */ + void *dummy = NULL; /* a dummy */ HFC_VAR; diff --git a/sys/net/i4b/layer1/isic/i4b_avm_a1.c b/sys/net/i4b/layer1/isic/i4b_avm_a1.c index 4b460aede2..de3539d20b 100644 --- a/sys/net/i4b/layer1/isic/i4b_avm_a1.c +++ b/sys/net/i4b/layer1/isic/i4b_avm_a1.c @@ -36,7 +36,6 @@ * ------------------------------------------------------------ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_avm_a1.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_avm_a1.c,v 1.7 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Jan 24 09:25:23 2001] * @@ -163,8 +162,8 @@ int isic_probe_avma1(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* pointer to softc */ + void *ih = NULL; /* dummy */ bus_space_tag_t t; /* bus things */ bus_space_handle_t h; u_char savebyte; diff --git a/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c b/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c index dd13eb64b6..2911222d1b 100644 --- a/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c +++ b/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c @@ -28,7 +28,6 @@ * ================================================================ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_elsa_pcc16.c,v 1.5.2.2 2001/10/24 14:17:20 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_elsa_pcc16.c,v 1.7 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Oct 24 16:15:26 2001] * @@ -222,8 +221,8 @@ int isic_probe_Epcc16(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* pointer to softc */ + void *ih = NULL; /* dummy */ /* check max unit range */ if(unit >= ISIC_MAXUNIT) diff --git a/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c b/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c index b9e94cb70e..90c5b68192 100644 --- a/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c +++ b/sys/net/i4b/layer1/isic/i4b_elsa_qs1p.c @@ -238,7 +238,7 @@ eqs1p_pci_attach(device_t dev) bus_space_tag_t t; bus_space_handle_t h; struct l1_softc *sc; - void *ih = 0; + void *ih = NULL; int unit = device_get_unit(dev); /* check max unit range */ diff --git a/sys/net/i4b/layer1/isic/i4b_isic_pnp.c b/sys/net/i4b/layer1/isic/i4b_isic_pnp.c index 5ae4cffe78..b2032d736a 100644 --- a/sys/net/i4b/layer1/isic/i4b_isic_pnp.c +++ b/sys/net/i4b/layer1/isic/i4b_isic_pnp.c @@ -173,8 +173,8 @@ isic_pnp_attach(device_t dev) u_int32_t vend_id = isa_get_vendorid(dev); /* vendor id */ unsigned int unit = device_get_unit(dev); /* get unit */ const char *name = device_get_desc(dev); /* get description */ - struct l1_softc *sc = 0; /* softc */ - void *ih = 0; /* a dummy */ + struct l1_softc *sc = NULL; /* softc */ + void *ih = NULL; /* a dummy */ int ret; /* see if we are out of bounds */ diff --git a/sys/net/i4b/layer1/isic/i4b_itk_ix1.c b/sys/net/i4b/layer1/isic/i4b_itk_ix1.c index 28ecec927b..72562686cc 100644 --- a/sys/net/i4b/layer1/isic/i4b_itk_ix1.c +++ b/sys/net/i4b/layer1/isic/i4b_itk_ix1.c @@ -29,7 +29,6 @@ * last edit-date: [Wed Jan 24 09:27:06 2001] * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_itk_ix1.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_itk_ix1.c,v 1.7 2007/05/17 08:19:02 swildner Exp $ * *--------------------------------------------------------------------------- * @@ -183,8 +182,8 @@ int isic_probe_itkix1(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* softc */ + void *ih = NULL; /* dummy */ bus_space_tag_t t; /* bus things */ bus_space_handle_t h; u_int8_t hd, hv1, hv2, saveale; diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s016.c b/sys/net/i4b/layer1/isic/i4b_tel_s016.c index cd8963ad9d..c934c02c0d 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s016.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s016.c @@ -38,7 +38,6 @@ * ================================================================= * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s016.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s016.c,v 1.7 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Jan 24 09:27:24 2001] * @@ -130,8 +129,8 @@ int isic_probe_s016(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* softc */ + void *ih = NULL; /* dummy */ u_int8_t b0,b1,b2; /* for signature */ bus_space_tag_t t; /* bus things */ bus_space_handle_t h; diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s0163.c b/sys/net/i4b/layer1/isic/i4b_tel_s0163.c index 5369109b4c..8f9c55bc16 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s0163.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s0163.c @@ -38,7 +38,6 @@ * ======================================================== * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s0163.c,v 1.5.2.1 2001/08/10 14:08:38 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s0163.c,v 1.6 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Jan 24 09:27:40 2001] * @@ -118,8 +117,8 @@ int isic_probe_s0163(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* pointer to softc */ + void *ih = NULL; /* dummy */ bus_space_tag_t t; /* bus things */ bus_space_handle_t h; u_int8_t b0,b1,b2; /* signature */ diff --git a/sys/net/i4b/layer1/isic/i4b_tel_s08.c b/sys/net/i4b/layer1/isic/i4b_tel_s08.c index f97b0fb606..b4013172f7 100644 --- a/sys/net/i4b/layer1/isic/i4b_tel_s08.c +++ b/sys/net/i4b/layer1/isic/i4b_tel_s08.c @@ -38,7 +38,6 @@ * ================================================================ * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_tel_s08.c,v 1.5.2.1 2001/08/10 14:08:39 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_tel_s08.c,v 1.7 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Jan 24 09:27:58 2001] * @@ -129,8 +128,8 @@ int isic_probe_s08(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* pointer to softc */ + void *ih = NULL; /* dummy */ /* check max unit range */ diff --git a/sys/net/i4b/layer1/isic/i4b_usr_sti.c b/sys/net/i4b/layer1/isic/i4b_usr_sti.c index 22460a475f..f4c96ff74c 100644 --- a/sys/net/i4b/layer1/isic/i4b_usr_sti.c +++ b/sys/net/i4b/layer1/isic/i4b_usr_sti.c @@ -28,7 +28,6 @@ * ------------------------------------------------------------- * * $FreeBSD: src/sys/i4b/layer1/isic/i4b_usr_sti.c,v 1.5.2.1 2001/08/10 14:08:39 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer1/isic/i4b_usr_sti.c,v 1.8 2006/12/22 23:44:56 swildner Exp $ * * last edit-date: [Wed Jan 24 09:28:12 2001] * @@ -307,8 +306,8 @@ int isic_probe_usrtai(device_t dev) { size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ - void *ih = 0; /* dummy */ + struct l1_softc *sc = NULL; /* pointer to softc */ + void *ih = NULL; /* dummy */ /* check max unit range */ @@ -464,7 +463,7 @@ isic_attach_usrtai(device_t dev) { u_char irq = 0; size_t unit = device_get_unit(dev); /* get unit */ - struct l1_softc *sc = 0; /* pointer to softc */ + struct l1_softc *sc = NULL; /* pointer to softc */ sc = &l1_sc[unit]; /* get pointer to softc */ diff --git a/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c b/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c index 72b133a529..9d4d947ea6 100644 --- a/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c +++ b/sys/net/i4b/layer1/itjc/i4b_itjc_pci.c @@ -1525,7 +1525,7 @@ itjc_attach(device_t dev) res_init_level = 0, error = 0; - void *ih = 0; + void *ih = NULL; dma_context_t *ctx = &dma_context[unit]; diff --git a/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c b/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c index b106f4461f..20a2d36476 100644 --- a/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c +++ b/sys/net/i4b/layer1/iwic/i4b_iwic_pci.c @@ -182,7 +182,7 @@ iwic_pci_attach(device_t dev) { unsigned short iobase; struct iwic_softc *sc; - void *ih = 0; + void *ih = NULL; int unit = device_get_unit(dev); struct iwic_bchan *bchan; diff --git a/sys/net/if.c b/sys/net/if.c index 07cfc6ca18..99db92179f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1196,7 +1196,7 @@ next: continue; * before continuing to search * for an even better one. */ - if (ifa_maybe == 0 || + if (ifa_maybe == NULL || rn_refines((char *)ifa->ifa_netmask, (char *)ifa_maybe->ifa_netmask)) ifa_maybe = ifa; @@ -1216,7 +1216,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp) struct ifaddr_container *ifac; char *cp, *cp2, *cp3; char *cplim; - struct ifaddr *ifa_maybe = 0; + struct ifaddr *ifa_maybe = NULL; u_int af = addr->sa_family; if (af >= AF_MAX) @@ -1226,7 +1226,7 @@ ifaof_ifpforaddr(struct sockaddr *addr, struct ifnet *ifp) if (ifa->ifa_addr->sa_family != af) continue; - if (ifa_maybe == 0) + if (ifa_maybe == NULL) ifa_maybe = ifa; if (ifa->ifa_netmask == NULL) { if (sa_equal(addr, ifa->ifa_addr) || @@ -2094,7 +2094,7 @@ if_addmulti( if (error) return error; } else { - llsa = 0; + llsa = NULL; } ifma = kmalloc(sizeof *ifma, M_IFMADDR, M_WAITOK); @@ -2118,7 +2118,7 @@ if_addmulti( if (retifma) *retifma = ifma; - if (llsa != 0) { + if (llsa != NULL) { TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (sa_equal(ifma->ifma_addr, llsa)) break; @@ -2163,7 +2163,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (sa_equal(sa, ifma->ifma_addr)) break; - if (ifma == 0) + if (ifma == NULL) return ENOENT; if (ifma->ifma_refcount > 1) { @@ -2179,7 +2179,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) * Make sure the interface driver is notified * in the case of a link layer mcast group being left. */ - if (ifma->ifma_addr->sa_family == AF_LINK && sa == 0) { + if (ifma->ifma_addr->sa_family == AF_LINK && sa == NULL) { ifnet_serialize_all(ifp); ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL); ifnet_deserialize_all(ifp); @@ -2187,7 +2187,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) crit_exit(); kfree(ifma->ifma_addr, M_IFMADDR); kfree(ifma, M_IFMADDR); - if (sa == 0) + if (sa == NULL) return 0; /* @@ -2204,7 +2204,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (sa_equal(sa, ifma->ifma_addr)) break; - if (ifma == 0) + if (ifma == NULL) return 0; if (ifma->ifma_refcount > 1) { diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 71032895be..cfc4bcaad8 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -699,7 +699,7 @@ ether_resolvemulti( e_addr = LLADDR(sdl); if ((e_addr[0] & 1) != 1) return EADDRNOTAVAIL; - *llsa = 0; + *llsa = NULL; return 0; #ifdef INET @@ -728,7 +728,7 @@ ether_resolvemulti( * (This is used for multicast routers.) */ ifp->if_flags |= IFF_ALLMULTI; - *llsa = 0; + *llsa = NULL; return 0; } if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 2eb8c0d0af..e3f6724a66 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -237,7 +237,7 @@ rel: ifq_classify(&ifp->if_snd, m, af, &pktattr); M_PREPEND(m, sizeof(int32_t), MB_DONTWAIT); - if (m == 0) + if (m == NULL) return(ENOBUFS); afp = mtod(m, int32_t *); *afp = (int32_t)af; @@ -379,7 +379,7 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { error = EAFNOSUPPORT; /* XXX */ break; } diff --git a/sys/net/ip6fw/ip6_fw.c b/sys/net/ip6fw/ip6_fw.c index c5bfab9aaa..ef3f567f1b 100644 --- a/sys/net/ip6fw/ip6_fw.c +++ b/sys/net/ip6fw/ip6_fw.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/ip6_fw.c,v 1.2.2.10 2003/08/03 17:52:54 ume Exp $ */ -/* $DragonFly: src/sys/net/ip6fw/ip6_fw.c,v 1.19 2008/03/07 11:34:20 sephe Exp $ */ /* $KAME: ip6_fw.c,v 1.21 2001/01/24 01:25:32 itojun Exp $ */ /* @@ -805,7 +804,7 @@ got_match: - off - (ti.th.th_off << 2); } else { m_freem(*m); - *m = 0; + *m = NULL; break; } seq = 0; @@ -841,8 +840,8 @@ dropit: static int add_entry6(struct ip6_fw_head *chainptr, struct ip6_fw *frwl) { - struct ip6_fw *ftmp = 0; - struct ip6_fw_chain *fwc = 0, *fcp, *fcpl = 0; + struct ip6_fw *ftmp = NULL; + struct ip6_fw_chain *fwc = NULL, *fcp, *fcpl = NULL; u_short nbr = 0; fwc = kmalloc(sizeof *fwc, M_IP6FW, M_INTWAIT); @@ -1136,7 +1135,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) if (securelevel > 2) { if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return(EPERM); } @@ -1152,7 +1151,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) } if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return (0); } @@ -1160,7 +1159,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) error = zero_entry6(m); if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return (error); } @@ -1178,7 +1177,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) error = add_entry6(&ip6_fw_chain, frwl); if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return error; } @@ -1195,7 +1194,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) mtod(m, struct ip6_fw *)->fw_number); if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return error; } @@ -1203,7 +1202,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) dprintf(("%s unknown request %d\n", err_prefix, stage)); if (m) { m_freem(m); - *mm = 0; + *mm = NULL; } return (EINVAL); } diff --git a/sys/net/ip_mroute/ip_mroute.c b/sys/net/ip_mroute/ip_mroute.c index b2a395971f..b1d8c359a8 100644 --- a/sys/net/ip_mroute/ip_mroute.c +++ b/sys/net/ip_mroute/ip_mroute.c @@ -18,7 +18,6 @@ * bandwidth metering and signaling * * $FreeBSD: src/sys/netinet/ip_mroute.c,v 1.56.2.10 2003/08/24 21:37:34 hsu Exp $ - * $DragonFly: src/sys/net/ip_mroute/ip_mroute.c,v 1.23 2008/06/17 20:50:11 aggelos Exp $ */ #include "opt_mrouting.h" @@ -3064,7 +3063,7 @@ pim_input(struct mbuf **mp, int *offp, int proto) * possibly the PIM REGISTER header. */ if ((m->m_flags & M_EXT || m->m_len < minlen) && - (m = m_pullup(m, minlen)) == 0) { + (m = m_pullup(m, minlen)) == NULL) { log(LOG_ERR, "pim_input: m_pullup failure\n"); return(IPPROTO_DONE); } diff --git a/sys/net/ppp/if_ppp.c b/sys/net/ppp/if_ppp.c index c8795f0179..7b1135ecf4 100644 --- a/sys/net/ppp/if_ppp.c +++ b/sys/net/ppp/if_ppp.c @@ -558,14 +558,14 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, return EINVAL; } } else - newcode = 0; + newcode = NULL; bp = (cmd == PPPIOCSPASS)? &sc->sc_pass_filt: &sc->sc_active_filt; oldcode = bp->bf_insns; crit_enter(); bp->bf_len = nbp->bf_len; bp->bf_insns = newcode; crit_exit(); - if (oldcode != 0) + if (oldcode != NULL) kfree(oldcode, M_DEVBUF); break; #endif @@ -650,7 +650,7 @@ pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCADDMULTI: case SIOCDELMULTI: - if (ifr == 0) { + if (ifr == NULL) { error = EAFNOSUPPORT; break; } @@ -794,7 +794,7 @@ pppoutput_serialized(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, */ if (M_LEADINGSPACE(m0) < PPP_HDRLEN) { m0 = m_prepend(m0, PPP_HDRLEN, MB_DONTWAIT); - if (m0 == 0) { + if (m0 == NULL) { error = ENOBUFS; goto bad; } @@ -810,7 +810,7 @@ pppoutput_serialized(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, m0->m_len += PPP_HDRLEN; len = 0; - for (m = m0; m != 0; m = m->m_next) + for (m = m0; m != NULL; m = m->m_next) len += m->m_len; if (sc->sc_flags & SC_LOG_OUTPKT) { diff --git a/sys/net/sppp/if_spppsubr.c b/sys/net/sppp/if_spppsubr.c index e7b4f46262..676e91235e 100644 --- a/sys/net/sppp/if_spppsubr.c +++ b/sys/net/sppp/if_spppsubr.c @@ -4857,7 +4857,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask) * Pick the first AF_INET address from the list, * aliases don't make any sense on a p2p link anyway. */ - si = 0; + si = NULL; TAILQ_FOREACH(ifac, &ifp->if_addrheads[mycpuid], ifa_link) { ifa = ifac->ifa; if (ifa->ifa_addr->sa_family == AF_INET) { @@ -4899,7 +4899,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long src) * Pick the first AF_INET address from the list, * aliases don't make any sense on a p2p link anyway. */ - si = 0; + si = NULL; TAILQ_FOREACH(ifac, &ifp->if_addrheads[mycpuid], ifa_link) { ifa = ifac->ifa; if (ifa->ifa_addr->sa_family == AF_INET) { @@ -4969,7 +4969,7 @@ sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, * Pick the first link-local AF_INET6 address from the list, * aliases don't make any sense on a p2p link anyway. */ - si = 0; + si = NULL; TAILQ_FOREACH(ifac, &ifp->if_addrheads[mycpuid], ifa_link) { ifa = ifac->ifa; if (ifa->ifa_addr->sa_family == AF_INET6) { diff --git a/sys/net/tun/if_tun.c b/sys/net/tun/if_tun.c index 64f9560ae8..e0cc1ef31b 100644 --- a/sys/net/tun/if_tun.c +++ b/sys/net/tun/if_tun.c @@ -493,7 +493,7 @@ tunioctl(struct dev_ioctl_args *ap) struct mbuf *mb; mb = ifq_poll(&tp->tun_if.if_snd); - for( *(int *)ap->a_data = 0; mb != 0; mb = mb->m_next) + for( *(int *)ap->a_data = 0; mb != NULL; mb = mb->m_next) *(int *)ap->a_data += mb->m_len; } else { *(int *)ap->a_data = 0; @@ -615,7 +615,7 @@ tunwrite(struct dev_write_args *ap) mp = &m->m_next; if (uio->uio_resid > 0) { MGET (m, MB_WAIT, MT_DATA); - if (m == 0) { + if (m == NULL) { error = ENOBUFS; break; } diff --git a/sys/netgraph/socket/ng_socket.c b/sys/netgraph/socket/ng_socket.c index 98aea445d0..372076d48d 100644 --- a/sys/netgraph/socket/ng_socket.c +++ b/sys/netgraph/socket/ng_socket.c @@ -438,7 +438,7 @@ ng_setsockaddr(netmsg_t msg) crit_enter(); pcbp = sotongpcb(so); - if ((pcbp == 0) || (pcbp->sockdata == NULL)) { + if ((pcbp == NULL) || (pcbp->sockdata == NULL)) { crit_exit(); error = EINVAL; goto out; diff --git a/sys/netgraph7/atm/ccatm/ng_ccatm.c b/sys/netgraph7/atm/ccatm/ng_ccatm.c index c583a2e326..c038e19415 100644 --- a/sys/netgraph7/atm/ccatm/ng_ccatm.c +++ b/sys/netgraph7/atm/ccatm/ng_ccatm.c @@ -31,8 +31,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/netgraph/atm/ccatm/ng_ccatm.c,v 1.3 2006/09/30 12:37:43 netchild Exp $ - * $DragonFly: src/sys/netgraph7/atm/ccatm/ng_ccatm.c,v 1.2 2008/06/26 23:05:39 dillon Exp $ - * $DragonFly: src/sys/netgraph7/atm/ccatm/ng_ccatm.c,v 1.2 2008/06/26 23:05:39 dillon Exp $ * * ATM call control and API */ @@ -442,7 +440,7 @@ send_dump(struct ccdata *data, void *uarg, const char *buf) m->m_pkthdr.len = 0; } else { m = m_getcl(MB_DONTWAIT, MT_DATA, 0); - if (m == 0) { + if (m == NULL) { m_freem(priv->dump_first); return (ENOBUFS); } diff --git a/sys/netgraph7/ng_socket.c b/sys/netgraph7/ng_socket.c index 80ab4734e1..1103b77251 100644 --- a/sys/netgraph7/ng_socket.c +++ b/sys/netgraph7/ng_socket.c @@ -344,7 +344,7 @@ ngc_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { struct ngpcb *const pcbp = sotongpcb(so); - if (pcbp == 0) + if (pcbp == NULL) return (EINVAL); return (ng_bind(nam, pcbp)); } @@ -458,7 +458,7 @@ ngd_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { struct ngpcb *const pcbp = sotongpcb(so); - if (pcbp == 0) + if (pcbp == NULL) return (EINVAL); return (ng_connect_data(nam, pcbp)); } diff --git a/sys/netgraph7/ng_source.c b/sys/netgraph7/ng_source.c index 1ee3f5767e..4a32cb2575 100644 --- a/sys/netgraph7/ng_source.c +++ b/sys/netgraph7/ng_source.c @@ -38,7 +38,6 @@ * Author: Dave Chapeskie * * $FreeBSD: src/sys/netgraph/ng_source.c,v 1.30 2007/03/02 14:36:19 emaste Exp $ - * $DragonFly: src/sys/netgraph7/ng_source.c,v 1.2 2008/06/26 23:05:35 dillon Exp $ */ /* @@ -296,7 +295,7 @@ ng_source_newhook(node_p node, hook_p hook, const char *name) sc->input = hook; } else if (strcmp(name, NG_SOURCE_HOOK_OUTPUT) == 0) { sc->output = hook; - sc->output_ifp = 0; + sc->output_ifp = NULL; bzero(&sc->stats, sizeof(sc->stats)); } else return (EINVAL); diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 9dffe2e650..f754eca041 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -182,7 +182,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto) } minlen = iphlen + IGMP_MINLEN; if ((m->m_flags & M_EXT || m->m_len < minlen) && - (m = m_pullup(m, minlen)) == 0) { + (m = m_pullup(m, minlen)) == NULL) { ++igmpstat.igps_rcv_tooshort; return(IPPROTO_DONE); } diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 36842ff721..915a62fe80 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -32,7 +32,6 @@ * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/netinet/ip_icmp.c,v 1.39.2.19 2003/01/24 05:11:34 sam Exp $ - * $DragonFly: src/sys/netinet/ip_icmp.c,v 1.32 2008/10/27 02:56:30 sephe Exp $ */ #include "opt_ipsec.h" @@ -286,7 +285,7 @@ icmp_input(struct mbuf **mp, int *offp, int proto) goto freeit; } i = hlen + min(icmplen, ICMP_ADVLENMIN); - if (m->m_len < i && (m = m_pullup(m, i)) == 0) { + if (m->m_len < i && (m = m_pullup(m, i)) == NULL) { icmpstat.icps_tooshort++; return(IPPROTO_DONE); } @@ -512,7 +511,7 @@ badcode: } ia = (struct in_ifaddr *)ifaof_ifpforaddr( (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif); - if (ia == 0) + if (ia == NULL) break; if (ia->ia_ifp == 0) break; @@ -621,7 +620,7 @@ icmp_reflect(struct mbuf *m) struct ifaddr_container *ifac; struct ifnet *ifp; struct in_addr t; - struct mbuf *opts = 0; + struct mbuf *opts = NULL; int optlen = (IP_VHL_HL(ip->ip_vhl) << 2) - sizeof(struct ip); struct route *ro = NULL, rt; @@ -723,7 +722,7 @@ match: * add on any record-route or timestamp options. */ cp = (u_char *) (ip + 1); - if ((opts = ip_srcroute(m)) == 0 && + if ((opts = ip_srcroute(m)) == NULL && (opts = m_gethdr(MB_DONTWAIT, MT_HEADER))) { opts->m_len = sizeof(struct in_addr); mtod(opts, struct in_addr *)->s_addr = 0; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 47d6130715..cfcd895561 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1631,7 +1631,7 @@ ip_pcbopts(int optname, struct mbuf **pcbopt, struct mbuf *m) /* turn off any old options */ if (*pcbopt) m_free(*pcbopt); - *pcbopt = 0; + *pcbopt = NULL; if (m == NULL || m->m_len == 0) { /* * Only turning off any previous options. diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 8671b6e379..8f062609f2 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -32,7 +32,6 @@ * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.64.2.16 2003/08/24 08:24:38 hsu Exp $ - * $DragonFly: src/sys/netinet/raw_ip.c,v 1.33 2008/10/28 03:07:28 sephe Exp $ */ #include "opt_inet6.h" @@ -210,7 +209,7 @@ rip_input(struct mbuf **mp, int *offp, int proto) sorwakeup(last->inp_socket); } lwkt_reltoken(&last->inp_socket->so_rcv.ssb_token); - opts = 0; + opts = NULL; } } last = inp; @@ -586,7 +585,7 @@ rip_detach(netmsg_t msg) struct inpcb *inp; inp = so->so_pcb; - if (inp == 0) + if (inp == NULL) panic("rip_detach"); if (so == ip_mrouter && ip_mrouter_done) ip_mrouter_done(); diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index f6a84bba08..45d9009dbb 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4083,7 +4083,7 @@ sctp_input(struct mbuf **mp, int *offp, int proto) struct ip *ip; struct sctphdr *sh; struct sctp_inpcb *inp = NULL; - struct mbuf *opts = 0; + struct mbuf *opts = NULL; /*#ifdef INET6*/ /* Don't think this is needed */ /* struct ip6_recvpktopts opts6;*/ @@ -4130,7 +4130,7 @@ sctp_input(struct mbuf **mp, int *offp, int proto) ip = mtod(m, struct ip *); offset = iphlen + sizeof(*sh) + sizeof(*ch); if (m->m_len < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { sctp_pegs[SCTP_HDR_DROPS]++; return(IPPROTO_DONE); } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index d0580d567d..539be7a4bf 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -464,7 +464,7 @@ sctp_ctlinput(netmsg_t msg) } if (PRC_IS_REDIRECT(cmd)) { - ip = 0; + ip = NULL; } else if ((unsigned)cmd >= PRC_NCMDS || inetctlerrmap[cmd] == 0) { goto out; } @@ -811,7 +811,7 @@ sctp_send(netmsg_t msg) int error; struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { if (control) { sctp_m_freem(control); control = NULL; @@ -3538,7 +3538,7 @@ sctp_ctloutput(netmsg_t msg) inp = (struct sctp_inpcb *)so->so_pcb; - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ error = ECONNRESET; goto out; @@ -3730,7 +3730,7 @@ sctp_usr_recvd(netmsg_t msg) so, inp, (u_int)flags); #endif - if (inp == 0) { + if (inp == NULL) { /* I made the same as TCP since we are not setup? */ #ifdef SCTP_DEBUG if (sctp_debug_on & SCTP_DEBUG_USRREQ2) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 363c56d07c..8f3a93f42e 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3287,7 +3287,7 @@ sctp_sbappendaddr_nocheck(struct signalsockbuf *ssb, struct sockaddr *asa, struc return (0); try_again: MGETHDR(m, MB_DONTWAIT, MT_SONAME); - if (m == 0) + if (m == NULL) return (0); m->m_len = 0; /* safety */ diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 59f57c2ce5..1d4780a62c 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -32,7 +32,6 @@ * * @(#)tcp_debug.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/tcp_debug.c,v 1.16.2.1 2000/07/15 07:14:31 kris Exp $ - * $DragonFly: src/sys/netinet/tcp_debug.c,v 1.6 2006/12/22 23:57:52 swildner Exp $ */ #include "opt_inet.h" @@ -212,7 +211,7 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, void *ipgen, kprintf(" -> %s", tcpstates[tp->t_state]); /* print out internal state of tp !?! */ kprintf("\n"); - if (tp == 0) + if (tp == NULL) return; kprintf( "\trcv_(nxt,wnd,up) (%lx,%lx,%lx) snd_(una,nxt,max) (%lx,%lx,%lx)\n", diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index c6f4e32d88..2edd2ae951 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -537,7 +537,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) int drop_hdrlen; struct tcpcb *tp = NULL; int thflags; - struct socket *so = 0; + struct socket *so = NULL; int todrop, acked; boolean_t ourfinisacked, needoutput = FALSE; u_long tiwin; @@ -2773,7 +2773,7 @@ tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m, int off) } cnt -= m->m_len; m = m->m_next; - if (m == 0) + if (m == NULL) break; } panic("tcp_pulloutofband"); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 2a2f1fd552..33fbb45e0a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -175,7 +175,7 @@ tcp_usr_attach(netmsg_t msg) struct pru_attach_info *ai = msg->attach.nm_ai; int error; struct inpcb *inp; - struct tcpcb *tp = 0; + struct tcpcb *tp = NULL; TCPDEBUG0; soreference(so); diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index dfc1dfa7b3..f579714bb0 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/ah_input.c,v 1.1.2.6 2002/04/28 05:40:26 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/ah_input.c,v 1.14 2007/11/26 11:43:09 sephe Exp $ */ /* $KAME: ah_input.c,v 1.67 2002/01/07 11:39:56 kjc Exp $ */ /* @@ -154,7 +153,7 @@ ah4_input(struct mbuf **mp, int *offp, int proto) if ((sav = key_allocsa(AF_INET, (caddr_t)&ip->ip_src, (caddr_t)&ip->ip_dst, - IPPROTO_AH, spi)) == 0) { + IPPROTO_AH, spi)) == NULL) { ipseclog((LOG_WARNING, "IPv4 AH input: no key association found for spi %u\n", (u_int32_t)ntohl(spi))); @@ -611,7 +610,7 @@ ah6_input(struct mbuf **mp, int *offp, int proto) if ((sav = key_allocsa(AF_INET6, (caddr_t)&ip6->ip6_src, (caddr_t)&ip6->ip6_dst, - IPPROTO_AH, spi)) == 0) { + IPPROTO_AH, spi)) == NULL) { ipseclog((LOG_WARNING, "IPv6 AH input: no key association found for spi %u\n", (u_int32_t)ntohl(spi))); diff --git a/sys/netinet6/esp_input.c b/sys/netinet6/esp_input.c index 239230426c..983a38d14b 100644 --- a/sys/netinet6/esp_input.c +++ b/sys/netinet6/esp_input.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/esp_input.c,v 1.1.2.8 2003/01/23 21:06:47 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/esp_input.c,v 1.17 2008/05/27 01:10:43 dillon Exp $ */ /* $KAME: esp_input.c,v 1.62 2002/01/07 11:39:57 kjc Exp $ */ /* @@ -155,7 +154,7 @@ esp4_input(struct mbuf **mp, int *offp, int proto) if ((sav = key_allocsa(AF_INET, (caddr_t)&ip->ip_src, (caddr_t)&ip->ip_dst, - IPPROTO_ESP, spi)) == 0) { + IPPROTO_ESP, spi)) == NULL) { ipseclog((LOG_WARNING, "IPv4 ESP input: no key association found for spi %u\n", (u_int32_t)ntohl(spi))); @@ -518,7 +517,7 @@ esp6_input(struct mbuf **mp, int *offp, int proto) if ((sav = key_allocsa(AF_INET6, (caddr_t)&ip6->ip6_src, (caddr_t)&ip6->ip6_dst, - IPPROTO_ESP, spi)) == 0) { + IPPROTO_ESP, spi)) == NULL) { ipseclog((LOG_WARNING, "IPv6 ESP input: no key association found for spi %u\n", (u_int32_t)ntohl(spi))); diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index ede646c8ca..c33dbf254b 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/icmp6.c,v 1.6.2.13 2003/05/06 06:46:58 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/icmp6.c,v 1.31 2008/10/27 02:56:30 sephe Exp $ */ /* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 itojun Exp $ */ /* @@ -1920,7 +1919,7 @@ icmp6_reflect(struct mbuf *m, size_t off) struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; struct in6_ifaddr *ia; - struct in6_addr t, *src = 0; + struct in6_addr t, *src = NULL; int plen; int type, code; struct ifnet *outif = NULL; @@ -2056,7 +2055,7 @@ icmp6_reflect(struct mbuf *m, size_t off) src = &t; } - if (src == 0) { + if (src == NULL) { int e; struct route_in6 ro; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index b606aab17e..0da3b45401 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2285,7 +2285,7 @@ in6_ifawithifp(struct ifnet *ifp, struct in6_addr *dst) { int dst_scope = in6_addrscope(dst), blen = -1, tlen; struct ifaddr_container *ifac; - struct in6_ifaddr *besta = 0; + struct in6_ifaddr *besta = NULL; struct in6_ifaddr *dep[2]; /* last-resort: deprecated */ dep[0] = dep[1] = NULL; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 146859c9c9..bd000d61eb 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -183,7 +183,7 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct thread *td) sin6->sin6_addr = kin6addr_any; return(EINVAL); } - if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == 0) + if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == NULL) return (EADDRNOTAVAIL); /* @@ -337,7 +337,7 @@ in6_pcbladdr(struct inpcb *inp, struct sockaddr *nam, inp->in6p_moptions, &inp->in6p_route, &inp->in6p_laddr, &error, td); - if (*plocal_addr6 == 0) { + if (*plocal_addr6 == NULL) { if (error == 0) error = EADDRNOTAVAIL; return (error); diff --git a/sys/netinet6/in6_prefix.c b/sys/netinet6/in6_prefix.c index 0099540c9f..ac648c6399 100644 --- a/sys/netinet6/in6_prefix.c +++ b/sys/netinet6/in6_prefix.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/in6_prefix.c,v 1.4.2.3 2001/07/03 11:01:52 ume Exp $ */ -/* $DragonFly: src/sys/netinet6/in6_prefix.c,v 1.13 2008/03/07 11:34:21 sephe Exp $ */ /* $KAME: in6_prefix.c,v 1.47 2001/03/25 08:41:39 itojun Exp $ */ /* @@ -206,7 +205,7 @@ search_matched_prefix(struct ifnet *ifp, struct in6_prefixreq *ipr) return NULL; rpp = ifpr2rp(((struct in6_ifaddr *)ifa)->ia6_ifpr); - if (rpp != 0) + if (rpp != NULL) return rpp; for (ifpr = TAILQ_FIRST(&ifp->if_prefixhead); ifpr; @@ -273,7 +272,7 @@ mark_matched_prefixes(u_long cmd, struct ifnet *ifp, struct in6_rrenumreq *irr) irr->irr_m_maxlen < matchlen || irr->irr_m_len > matchlen) continue; rpp = ifpr2rp(((struct in6_ifaddr *)ifa)->ia6_ifpr); - if (rpp != 0) { + if (rpp != NULL) { matched = 1; rpp->rp_statef_addmark = 1; if (cmd == SIOCCIFPREFIX_IN6) diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 2308becf96..e5f23d6881 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -128,7 +128,7 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, struct sockaddr_in6 jsin6; struct ucred *cred = NULL; struct in6_addr *dst; - struct in6_ifaddr *ia6 = 0; + struct in6_ifaddr *ia6 = NULL; struct in6_pktinfo *pi = NULL; int jailed = 0; @@ -183,10 +183,10 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, jsin6.sin6_addr = (&ia6->ia_addr)->sin6_addr; if (!jailed_ip(cred->cr_prison, (struct sockaddr *)&jsin6)) - ia6 = 0; + ia6 = NULL; } - if (ia6 == 0) { + if (ia6 == NULL) { *errorp = EADDRNOTAVAIL; return (0); } @@ -220,10 +220,10 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, jsin6.sin6_addr = (&ia6->ia_addr)->sin6_addr; if (!jailed_ip(cred->cr_prison, (struct sockaddr *)&jsin6)) - ia6 = 0; + ia6 = NULL; } - if (ia6 == 0) { + if (ia6 == NULL) { *errorp = EADDRNOTAVAIL; return (0); } @@ -248,7 +248,7 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, if (ifp) { ia6 = in6_ifawithscope(ifp, dst); - if (ia6 == 0) { + if (ia6 == NULL) { *errorp = EADDRNOTAVAIL; return (0); } @@ -270,17 +270,17 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, rt = nd6_lookup(&sin6_next->sin6_addr, 1, NULL); if (rt) { ia6 = in6_ifawithscope(rt->rt_ifp, dst); - if (ia6 == 0) + if (ia6 == NULL) ia6 = ifatoia6(rt->rt_ifa); } if (ia6 && jailed) { jsin6.sin6_addr = (&ia6->ia_addr)->sin6_addr; if (!jailed_ip(cred->cr_prison, (struct sockaddr *)&jsin6)) - ia6 = 0; + ia6 = NULL; } - if (ia6 == 0) { + if (ia6 == NULL) { *errorp = EADDRNOTAVAIL; return (0); } @@ -332,17 +332,17 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, jsin6.sin6_addr = (&ia6->ia_addr)->sin6_addr; if (!jailed_ip(cred->cr_prison, (struct sockaddr *)&jsin6)) - ia6 = 0; + ia6 = NULL; } - if (ia6 == 0) /* xxx scope error ?*/ + if (ia6 == NULL) /* xxx scope error ?*/ ia6 = ifatoia6(ro->ro_rt->rt_ifa); if (ia6 && jailed) { jsin6.sin6_addr = (&ia6->ia_addr)->sin6_addr; if (!jailed_ip(cred->cr_prison, (struct sockaddr *)&jsin6)) - ia6 = 0; + ia6 = NULL; } } #if 0 @@ -364,7 +364,7 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, return (&satosin6(&ia6->ia_addr)->sin6_addr); } #endif /* 0 */ - if (ia6 == 0) { + if (ia6 == NULL) { *errorp = EHOSTUNREACH; /* no route */ return (0); } diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 286c10f663..1a10a0abe3 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -175,7 +175,7 @@ ip6_init(void) struct timeval tv; pr = pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW); - if (pr == 0) + if (pr == NULL) panic("ip6_init"); for (i = 0; i < IPPROTO_MAX; i++) ip6_protox[i] = pr - inet6sw; @@ -312,7 +312,7 @@ ip6_input(netmsg_t msg) if (m->m_len < sizeof(struct ip6_hdr)) { struct ifnet *inifp; inifp = m->m_pkthdr.rcvif; - if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == 0) { + if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { ip6stat.ip6s_toosmall++; in6_ifstat_inc(inifp, ifs6_in_hdrerr); goto bad2; @@ -474,7 +474,7 @@ ip6_input(netmsg_t msg) * Multicast check */ if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - struct in6_multi *in6m = 0; + struct in6_multi *in6m = NULL; in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_mcast); /* diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 87b52de0ca..66e76b8446 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/nd6_rtr.c,v 1.2.2.5 2003/04/05 10:28:53 ume Exp $ */ -/* $DragonFly: src/sys/netinet6/nd6_rtr.c,v 1.17 2008/03/07 11:34:21 sephe Exp $ */ /* $KAME: nd6_rtr.c,v 1.111 2001/04/27 01:37:15 jinmei Exp $ */ /* @@ -1259,7 +1258,7 @@ pfxlist_onlink_check(void) find_pfxlist_reachable_router(pr) == NULL) pr->ndpr_stateflags |= NDPRF_DETACHED; if ((pr->ndpr_stateflags & NDPRF_DETACHED) && - find_pfxlist_reachable_router(pr) != 0) + find_pfxlist_reachable_router(pr) != NULL) pr->ndpr_stateflags &= ~NDPRF_DETACHED; } } else { diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 4e542c4b3d..c822786afc 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -139,7 +139,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto) struct mbuf *m = *mp; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct inpcb *in6p; - struct inpcb *last = 0; + struct inpcb *last = NULL; struct mbuf *opts = NULL; struct sockaddr_in6 rip6src; @@ -342,7 +342,7 @@ rip6_output(struct mbuf *m, struct socket *so, ...) struct inpcb *in6p; u_int plen = m->m_pkthdr.len; int error = 0; - struct ip6_pktopts opt, *optp = 0; + struct ip6_pktopts opt, *optp = NULL; struct ifnet *oifp = NULL; int type = 0, code = 0; /* for ICMPv6 output statistics only */ int priv = 0; diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c index 63be39d0ce..6c3088f5f2 100644 --- a/sys/netinet6/udp6_output.c +++ b/sys/netinet6/udp6_output.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/udp6_output.c,v 1.1.2.6 2003/01/23 21:06:47 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/udp6_output.c,v 1.9 2008/09/04 09:08:22 hasso Exp $ */ /* $KAME: udp6_output.c,v 1.31 2001/05/21 16:39:15 jinmei Exp $ */ /* @@ -252,7 +251,7 @@ udp6_output(struct in6pcb *in6p, struct mbuf *m, struct sockaddr *addr6, * for UDP and IP6 headers. */ M_PREPEND(m, hlen + sizeof(struct udphdr), MB_DONTWAIT); - if (m == 0) { + if (m == NULL) { error = ENOBUFS; goto release; } diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 2b43d8ac45..c326bd364a 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netinet6/udp6_usrreq.c,v 1.6.2.13 2003/01/24 05:11:35 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/udp6_usrreq.c,v 1.26 2007/04/22 01:13:14 dillon Exp $ */ /* $KAME: udp6_usrreq.c,v 1.27 2001/05/21 05:45:10 jinmei Exp $ */ /* @@ -820,7 +819,7 @@ udp6_send(netmsg_t msg) if (!ip6_v6only) { int hasv4addr; - struct sockaddr_in6 *sin6 = 0; + struct sockaddr_in6 *sin6 = NULL; if (addr == NULL) hasv4addr = (inp->inp_vflag & INP_IPV4); diff --git a/sys/netproto/atm/atm_cm.c b/sys/netproto/atm/atm_cm.c index 4a0bd6044b..a994165be0 100644 --- a/sys/netproto/atm/atm_cm.c +++ b/sys/netproto/atm/atm_cm.c @@ -24,7 +24,6 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/atm_cm.c,v 1.6 1999/08/28 00:48:34 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/atm_cm.c,v 1.7 2006/01/14 13:36:39 swildner Exp $ */ /* @@ -2724,7 +2723,7 @@ atm_cm_cpcs_data(Atm_connection *cop, KBuffer *m) * onto the front of the packet */ KB_ALLOCPKT(n, len, KB_F_NOWAIT, KB_T_HEADER); - if (n == 0) { + if (n == NULL) { err = ENOMEM; goto done; } @@ -2843,7 +2842,7 @@ atm_cm_cpcs_upper(int cmd, void *tok, int arg1, int arg2) */ if (KB_LEN(m) < T_ATM_LLC_MAX_LEN) { KB_PULLUP(m, T_ATM_LLC_MAX_LEN, m); - if (m == 0) { + if (m == NULL) { atm_cm_stat.cms_llcdrop++; return; } diff --git a/sys/netproto/atm/spans/spans_arp.c b/sys/netproto/atm/spans/spans_arp.c index 0f41d3eebb..d7862b115d 100644 --- a/sys/netproto/atm/spans/spans_arp.c +++ b/sys/netproto/atm/spans/spans_arp.c @@ -24,7 +24,6 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_arp.c,v 1.7 2000/01/15 20:34:55 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_arp.c,v 1.9 2006/01/14 13:36:39 swildner Exp $ */ /* @@ -581,7 +580,7 @@ spansarp_input(struct spanscls *clp, KBuffer *m) */ if (KB_LEN(m) < ARP_PACKET_LEN) { KB_PULLUP(m, ARP_PACKET_LEN, m); - if (m == 0) + if (m == NULL) return; } KB_DATASTART(m, chp, struct spanscls_hdr *); diff --git a/sys/netproto/atm/spans/spans_cls.c b/sys/netproto/atm/spans/spans_cls.c index 5cc9f1bfab..996cc13d4b 100644 --- a/sys/netproto/atm/spans/spans_cls.c +++ b/sys/netproto/atm/spans/spans_cls.c @@ -24,7 +24,6 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_cls.c,v 1.6 1999/08/28 00:48:49 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_cls.c,v 1.8 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -556,7 +555,7 @@ spanscls_bcast_output(struct ip_nif *inp, KBuffer *m) */ KB_ALLOCPKT(n, sizeof(struct spanscls_hdr), KB_F_NOWAIT, KB_T_HEADER); - if (n == 0) { + if (n == NULL) { KB_FREEALL(m); return (ENOBUFS); } @@ -638,7 +637,7 @@ spanscls_cpcs_data(void *tok, KBuffer *m) */ if (KB_LEN(m) < sizeof(struct spanscls_hdr)) { KB_PULLUP(m, sizeof(struct spanscls_hdr), m); - if (m == 0) + if (m == NULL) return; } KB_DATASTART(m, chp, struct spanscls_hdr *); diff --git a/sys/netproto/atm/uni/unisig_msg.c b/sys/netproto/atm/uni/unisig_msg.c index 1b16424084..6c3aef082c 100644 --- a/sys/netproto/atm/uni/unisig_msg.c +++ b/sys/netproto/atm/uni/unisig_msg.c @@ -24,7 +24,6 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/unisig_msg.c,v 1.6 2000/01/17 20:49:56 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/unisig_msg.c,v 1.7 2006/01/14 13:36:39 swildner Exp $ */ /* @@ -781,8 +780,8 @@ unisig_rcv_msg(struct unisig *usp, KBuffer *m) int err; u_int cref; struct usfmt usf; - struct unisig_msg *msg = 0; - struct unisig_vccb *uvp = 0; + struct unisig_msg *msg = NULL; + struct unisig_vccb *uvp = NULL; struct ie_generic *iep; ATM_DEBUG2("unisig_rcv_msg: bfr=%p, len=%d\n", m, KB_LEN(m)); diff --git a/sys/netproto/ipsec/ipsec_mbuf.c b/sys/netproto/ipsec/ipsec_mbuf.c index addbd2e395..b790e0a282 100644 --- a/sys/netproto/ipsec/ipsec_mbuf.c +++ b/sys/netproto/ipsec/ipsec_mbuf.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netipsec/ipsec_mbuf.c,v 1.5.2.2 2003/03/28 20:32:53 sam Exp $ - * $DragonFly: src/sys/netproto/ipsec/ipsec_mbuf.c,v 1.7 2006/12/22 23:57:54 swildner Exp $ */ /* @@ -359,7 +358,7 @@ KASSERT(m0->m_next != NULL, ("m_pad: m0 null, len %u m_len %u", len, m0->m_len)) if (pad > M_TRAILINGSPACE(m0)) { /* Add an mbuf to the chain. */ MGET(m1, MB_DONTWAIT, MT_DATA); - if (m1 == 0) { + if (m1 == NULL) { m_freem(m0); DPRINTF(("m_pad: unable to get extra mbuf\n")); return NULL; diff --git a/sys/netproto/ipsec/key.c b/sys/netproto/ipsec/key.c index cd0e00dc7f..086ca6f65d 100644 --- a/sys/netproto/ipsec/key.c +++ b/sys/netproto/ipsec/key.c @@ -5778,7 +5778,7 @@ static int key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { - struct secreg *reg, *newreg = 0; + struct secreg *reg, *newreg = NULL; /* sanity check */ if (so == NULL || m == NULL || mhp == NULL || mhp->msg == NULL) diff --git a/sys/netproto/ipsec/keysock.c b/sys/netproto/ipsec/keysock.c index 0f7f09c1c3..563dd97fea 100644 --- a/sys/netproto/ipsec/keysock.c +++ b/sys/netproto/ipsec/keysock.c @@ -84,7 +84,7 @@ key_output(struct mbuf *m, struct socket *so, ...) int len, error = 0; - if (m == 0) + if (m == NULL) panic("key_output: NULL pointer was passed.\n"); pfkeystat.out_total++; @@ -98,7 +98,7 @@ key_output(struct mbuf *m, struct socket *so, ...) } if (m->m_len < sizeof(struct sadb_msg)) { - if ((m = m_pullup(m, sizeof(struct sadb_msg))) == 0) { + if ((m = m_pullup(m, sizeof(struct sadb_msg))) == NULL) { pfkeystat.out_nomem++; error = ENOBUFS; goto end; @@ -184,7 +184,7 @@ key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int target) int tlen; /* sanity check */ - if (so == 0 || msg == 0) + if (so == NULL || msg == NULL) panic("key_sendup: NULL pointer was passed.\n"); KEYDEBUG(KEYDEBUG_KEY_DUMP, @@ -445,7 +445,7 @@ key_detach(struct socket *so) int error; crit_enter(); - if (kp != 0) { + if (kp != NULL) { if (kp->kp_raw.rcb_proto.sp_protocol == PF_KEY) /* XXX: AF_KEY */ key_cb.key_count--; diff --git a/sys/netproto/ipsec/xform_ipcomp.c b/sys/netproto/ipsec/xform_ipcomp.c index 0828e46163..5ac3a8e6e2 100644 --- a/sys/netproto/ipsec/xform_ipcomp.c +++ b/sys/netproto/ipsec/xform_ipcomp.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netipsec/xform_ipcomp.c,v 1.1.4.2 2003/02/26 00:14:06 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/xform_ipcomp.c,v 1.10 2006/10/12 01:32:51 hsu Exp $ */ /* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */ /* @@ -299,7 +298,7 @@ ipcomp_input_cb(struct cryptop *crp) /* In case it's not done already, adjust the size of the mbuf chain */ m->m_pkthdr.len = clen + hlen + skip; - if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == 0) { + if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == NULL) { ipcompstat.ipcomps_hdrops++; /*XXX*/ DPRINTF(("ipcomp_input_cb: m_pullup failed\n")); error = EINVAL; /*XXX*/ diff --git a/sys/netproto/ipsec/xform_ipip.c b/sys/netproto/ipsec/xform_ipip.c index 9cc13c0b5c..387f398434 100644 --- a/sys/netproto/ipsec/xform_ipip.c +++ b/sys/netproto/ipsec/xform_ipip.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/netipsec/xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/xform_ipip.c,v 1.15 2008/11/01 04:22:15 sephe Exp $ */ /* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -432,7 +431,7 @@ ipip_output( } M_PREPEND(m, sizeof(struct ip), MB_DONTWAIT); - if (m == 0) { + if (m == NULL) { DPRINTF(("ipip_output: M_PREPEND failed\n")); ipipstat.ipips_hdrops++; error = ENOBUFS; @@ -516,7 +515,7 @@ ipip_output( ip6->ip6_dst.s6_addr16[1] = 0; M_PREPEND(m, sizeof(struct ip6_hdr), MB_DONTWAIT); - if (m == 0) { + if (m == NULL) { DPRINTF(("ipip_output: M_PREPEND failed\n")); ipipstat.ipips_hdrops++; *mp = NULL; diff --git a/sys/netproto/ipx/ipx_input.c b/sys/netproto/ipx/ipx_input.c index 9f52d8768c..6ad58acbe0 100644 --- a/sys/netproto/ipx/ipx_input.c +++ b/sys/netproto/ipx/ipx_input.c @@ -34,7 +34,6 @@ * @(#)ipx_input.c * * $FreeBSD: src/sys/netipx/ipx_input.c,v 1.22.2.2 2001/02/22 09:44:18 bp Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx_input.c,v 1.20 2008/09/24 14:26:39 sephe Exp $ */ #include @@ -145,7 +144,7 @@ ipxintr(netmsg_t msg) ipxstat.ipxs_total++; if ((m->m_flags & M_EXT || m->m_len < sizeof(struct ipx)) && - (m = m_pullup(m, sizeof(struct ipx))) == 0) { + (m = m_pullup(m, sizeof(struct ipx))) == NULL) { ipxstat.ipxs_toosmall++; goto out; } diff --git a/sys/netproto/ipx/ipx_pcb.c b/sys/netproto/ipx/ipx_pcb.c index a51e26224b..72561fe56f 100644 --- a/sys/netproto/ipx/ipx_pcb.c +++ b/sys/netproto/ipx/ipx_pcb.c @@ -298,7 +298,7 @@ ipx_setpeeraddr(struct ipxpcb *ipxp, struct sockaddr **nam) struct ipxpcb * ipx_pcblookup(struct ipx_addr *faddr, int lport, int wildp) { - struct ipxpcb *ipxp, *match = 0; + struct ipxpcb *ipxp, *match = NULL; int matchwild = 3, wildcard; u_short fport; diff --git a/sys/netproto/ipx/spx_debug.c b/sys/netproto/ipx/spx_debug.c index bebc177153..f5b3e28bd6 100644 --- a/sys/netproto/ipx/spx_debug.c +++ b/sys/netproto/ipx/spx_debug.c @@ -34,7 +34,6 @@ * @(#)spx_debug.c * * $FreeBSD: src/sys/netipx/spx_debug.c,v 1.14 1999/08/28 00:49:43 peter Exp $ - * $DragonFly: src/sys/netproto/ipx/spx_debug.c,v 1.5 2006/12/22 23:57:54 swildner Exp $ */ #include "opt_inet.h" @@ -155,7 +154,7 @@ spx_trace(int act, int ostate, struct spxpcb *sp, struct spx *si, int req) kprintf(" -> %s", tcpstates[sp->s_state]); /* print out internal state of sp !?! */ kprintf("\n"); - if (sp == 0) + if (sp == NULL) return; #ifndef lint #define p3(f) { kprintf("%s = %x, ", "f", sp->s_ ## f); } diff --git a/sys/netproto/ipx/spx_usrreq.c b/sys/netproto/ipx/spx_usrreq.c index d4c1da8ec5..253f1a99b2 100644 --- a/sys/netproto/ipx/spx_usrreq.c +++ b/sys/netproto/ipx/spx_usrreq.c @@ -351,7 +351,7 @@ dropwithreset: drop: bad: - if (cb == 0 || cb->s_ipxpcb->ipxp_socket->so_options & SO_DEBUG || + if (cb == NULL || cb->s_ipxpcb->ipxp_socket->so_options & SO_DEBUG || traceallspxs) spx_trace(SA_DROP, (u_char)ostate, cb, &spx_savesi, 0); m_freem(m); @@ -955,7 +955,7 @@ send: if (si->si_seq == cb->s_snxt) cb->s_snxt++; else - spxstat.spxs_sndvoid++, si = 0; + spxstat.spxs_sndvoid++, si = NULL; } } /* diff --git a/sys/netproto/key/key.c b/sys/netproto/key/key.c index 16e75c8eae..86e7b67601 100644 --- a/sys/netproto/key/key.c +++ b/sys/netproto/key/key.c @@ -6111,7 +6111,7 @@ static int key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { - struct secreg *reg, *newreg = 0; + struct secreg *reg, *newreg = NULL; /* sanity check */ if (so == NULL || m == NULL || mhp == NULL || mhp->msg == NULL) diff --git a/sys/netproto/key/keysock.c b/sys/netproto/key/keysock.c index a76df73802..ef6b56a03f 100644 --- a/sys/netproto/key/keysock.c +++ b/sys/netproto/key/keysock.c @@ -81,7 +81,7 @@ key_output(struct mbuf *m, struct socket *so, ...) struct sadb_msg *msg; int len, error = 0; - if (m == 0) + if (m == NULL) panic("key_output: NULL pointer was passed.\n"); pfkeystat.out_total++; @@ -95,7 +95,7 @@ key_output(struct mbuf *m, struct socket *so, ...) } if (m->m_len < sizeof(struct sadb_msg)) { - if ((m = m_pullup(m, sizeof(struct sadb_msg))) == 0) { + if ((m = m_pullup(m, sizeof(struct sadb_msg))) == NULL) { pfkeystat.out_nomem++; error = ENOBUFS; goto end; @@ -185,7 +185,7 @@ key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int tlen; /* sanity check */ - if (so == 0 || msg == 0) + if (so == NULL || msg == NULL) panic("key_sendup: NULL pointer was passed.\n"); KEYDEBUG(KEYDEBUG_KEY_DUMP, diff --git a/sys/netproto/ncp/ncp_rq.c b/sys/netproto/ncp/ncp_rq.c index 4b289b094c..0897905c5f 100644 --- a/sys/netproto/ncp/ncp_rq.c +++ b/sys/netproto/ncp/ncp_rq.c @@ -32,7 +32,6 @@ * Routines to prepare request and fetch reply * * $FreeBSD: src/sys/netncp/ncp_rq.c,v 1.1.2.1 2001/05/21 16:27:20 ru Exp $ - * $DragonFly: src/sys/netproto/ncp/ncp_rq.c,v 1.10 2006/12/22 23:57:54 swildner Exp $ */ #include #include @@ -358,7 +357,7 @@ ncp_rp_mem(struct ncp_rq *rqp,caddr_t target, int size) { unsigned count; while (size > 0) { - if (m==0) { /* should be panic */ + if (m==NULL) { /* should be panic */ kprintf("ncp_rp_mem: incomplete copy\n"); return; } @@ -385,7 +384,7 @@ ncp_rp_usermem(struct ncp_rq *rqp,caddr_t target, int size) { int error; while (size>0) { - if (m==0) { /* should be panic */ + if (m==NULL) { /* should be panic */ kprintf("ncp_rp_mem: incomplete copy\n"); return EFAULT; } @@ -413,7 +412,7 @@ ncp_rp_mbuf(struct ncp_rq *rqp, int size) { rm = m_copym(m, rqp->bpos - mtod(m,caddr_t), size, MB_WAIT); while (size > 0) { - if (m == 0) { + if (m == NULL) { kprintf("ncp_rp_mbuf: can't advance\n"); return rm; } diff --git a/sys/netproto/ncp/ncp_sock.c b/sys/netproto/ncp/ncp_sock.c index 602507e5ec..ce822018e2 100644 --- a/sys/netproto/ncp/ncp_sock.c +++ b/sys/netproto/ncp/ncp_sock.c @@ -124,7 +124,7 @@ ncp_getsockname(struct socket *so, caddr_t asa, int *alen) { struct sockaddr *sa; int len=0, error; - sa = 0; + sa = NULL; error = so_pru_sockaddr(so, &sa); if (error==0) { if (sa) { @@ -158,7 +158,7 @@ int ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) { struct thread *td = curthread; /* XXX */ - struct sockaddr *to = 0; + struct sockaddr *to = NULL; struct ncp_conn *conn = rqp->conn; struct mbuf *m; int error, flags=0; diff --git a/sys/platform/pc32/i386/db_interface.c b/sys/platform/pc32/i386/db_interface.c index 76951c5f78..f0285b0784 100644 --- a/sys/platform/pc32/i386/db_interface.c +++ b/sys/platform/pc32/i386/db_interface.c @@ -24,7 +24,6 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.48.2.1 2000/07/07 00:38:46 obrien Exp $ - * $DragonFly: src/sys/platform/pc32/i386/db_interface.c,v 1.16 2007/01/08 03:33:42 dillon Exp $ */ /* @@ -49,7 +48,7 @@ #include -static jmp_buf *db_nofault = 0; +static jmp_buf *db_nofault = NULL; extern jmp_buf db_jmpbuf; extern void gdb_handle_exception (db_regs_t *, int, int); @@ -107,7 +106,7 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) if (db_nofault) { jmp_buf *no_fault = db_nofault; - db_nofault = 0; + db_nofault = NULL; longjmp(*no_fault, 1); } } @@ -212,7 +211,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *data++ = *src++; - db_nofault = 0; + db_nofault = NULL; } /* @@ -263,7 +262,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *dst++ = *data++; - db_nofault = 0; + db_nofault = NULL; if (ptep0) { *ptep0 = oldmap0; diff --git a/sys/platform/pc32/i386/dump_machdep.c b/sys/platform/pc32/i386/dump_machdep.c index a19cb27396..b956304561 100644 --- a/sys/platform/pc32/i386/dump_machdep.c +++ b/sys/platform/pc32/i386/dump_machdep.c @@ -162,7 +162,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) error = 0; /* catch case in which chunk size is 0 */ counter = 0; /* Update twiddle every 16MB */ - va = 0; + va = NULL; pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; diff --git a/sys/platform/pc32/i386/mptable.c b/sys/platform/pc32/i386/mptable.c index d2059a50eb..63f99356b5 100644 --- a/sys/platform/pc32/i386/mptable.c +++ b/sys/platform/pc32/i386/mptable.c @@ -23,7 +23,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.115.2.15 2003/03/14 21:22:35 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.60 2008/06/07 12:03:52 mneumann Exp $ */ #include "opt_cpu.h" @@ -854,7 +853,7 @@ mptable_lapic_probe(struct lapic_enumerator *e) error = EINVAL; cth = mpt.mp_cth; - if (cth->apic_address == 0) + if (cth->apic_address == NULL) goto done; bzero(&arg, sizeof(arg)); @@ -901,7 +900,7 @@ mptable_ioapic_list_callback(void *xarg, const void *pos, int type) if ((ent->apic_flags & IOAPICENTRY_FLAG_EN) == 0) return 0; - if (ent->apic_address == 0) { + if (ent->apic_address == NULL) { kprintf("mptable_ioapic_create_list: zero IOAPIC addr\n"); return EINVAL; } diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 0135d5bec8..48d98a84b6 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -377,7 +377,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, } rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == 0) + if (rv == NULL) return 0; rman_set_rid(rv, *rid); @@ -486,7 +486,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, if (irq == NULL) panic("nexus_setup_intr: NULL irq resource!"); - *cookiep = 0; + *cookiep = NULL; icflags = flags; if ((irq->r_flags & RF_SHAREABLE) == 0) icflags |= INTR_EXCL; diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index 24c3c21099..68f807ba01 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -176,10 +176,10 @@ SYSCTL_INT(_vm, OID_AUTO, dreadful_invltlb, /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1 = 0, *ptmmap; +pt_entry_t *CMAP1 = NULL, *ptmmap; caddr_t CADDR1 = 0, ptvmmap = 0; static pt_entry_t *msgbufmap; -struct msgbuf *msgbufp=0; +struct msgbuf *msgbufp=NULL; /* * Crashdump maps. diff --git a/sys/platform/pc32/isa/npx.c b/sys/platform/pc32/isa/npx.c index b62674caaa..dee11bc1c5 100644 --- a/sys/platform/pc32/isa/npx.c +++ b/sys/platform/pc32/isa/npx.c @@ -376,17 +376,17 @@ npx_probe1(device_t dev) r = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, IO_NPX, IO_NPX, IO_NPXSIZE, RF_ACTIVE); - if (r == 0) + if (r == NULL) panic("npx: can't get ports"); rid = 0; r = bus_alloc_legacy_irq_resource(dev, &rid, npx_irq, RF_ACTIVE); - if (r == 0) + if (r == NULL) panic("npx: can't get IRQ"); BUS_SETUP_INTR(device_get_parent(dev), dev, r, 0, npx_intr, 0, &intr, NULL); - if (intr == 0) + if (intr == NULL) panic("npx: can't create intr"); return (0); diff --git a/sys/platform/pc64/x86_64/db_interface.c b/sys/platform/pc64/x86_64/db_interface.c index 6a235b8d63..e3b76a8bcd 100644 --- a/sys/platform/pc64/x86_64/db_interface.c +++ b/sys/platform/pc64/x86_64/db_interface.c @@ -80,7 +80,7 @@ #include -static jmp_buf *db_nofault = 0; +static jmp_buf *db_nofault = NULL; extern jmp_buf db_jmpbuf; extern void gdb_handle_exception (db_regs_t *, int, int); @@ -138,7 +138,7 @@ kdb_trap(int type, int code, struct x86_64_saved_state *regs) if (db_nofault) { jmp_buf *no_fault = db_nofault; - db_nofault = 0; + db_nofault = NULL; longjmp(*no_fault, 1); } } @@ -244,7 +244,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *data++ = *src++; - db_nofault = 0; + db_nofault = NULL; } /* @@ -297,7 +297,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *dst++ = *data++; - db_nofault = 0; + db_nofault = NULL; #if 0 if (ptep0) { diff --git a/sys/platform/pc64/x86_64/db_trace.c b/sys/platform/pc64/x86_64/db_trace.c index b79a965b90..fa935e7f02 100644 --- a/sys/platform/pc64/x86_64/db_trace.c +++ b/sys/platform/pc64/x86_64/db_trace.c @@ -438,7 +438,7 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, } db_nextframe(&frame, &callpc); - if (frame == 0) + if (frame == NULL) break; } } diff --git a/sys/platform/pc64/x86_64/dump_machdep.c b/sys/platform/pc64/x86_64/dump_machdep.c index 222c55111e..9a144e05a7 100644 --- a/sys/platform/pc64/x86_64/dump_machdep.c +++ b/sys/platform/pc64/x86_64/dump_machdep.c @@ -161,7 +161,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) error = 0; /* catch case in which chunk size is 0 */ counter = 0; /* Update twiddle every 16MB */ - va = 0; + va = NULL; pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; diff --git a/sys/platform/pc64/x86_64/nexus.c b/sys/platform/pc64/x86_64/nexus.c index 1f999bc48e..d3b69e31f4 100644 --- a/sys/platform/pc64/x86_64/nexus.c +++ b/sys/platform/pc64/x86_64/nexus.c @@ -384,7 +384,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, } rv = rman_reserve_resource(rm, start, end, count, flags, child); - if (rv == 0) + if (rv == NULL) return 0; rman_set_rid(rv, *rid); @@ -493,7 +493,7 @@ nexus_setup_intr(device_t bus, device_t child, struct resource *irq, if (irq == NULL) panic("nexus_setup_intr: NULL irq resource!"); - *cookiep = 0; + *cookiep = NULL; icflags = flags; if ((irq->r_flags & RF_SHAREABLE) == 0) icflags |= INTR_EXCL; diff --git a/sys/platform/pc64/x86_64/pmap.c b/sys/platform/pc64/x86_64/pmap.c index 53615d8401..bb47bc455c 100644 --- a/sys/platform/pc64/x86_64/pmap.c +++ b/sys/platform/pc64/x86_64/pmap.c @@ -195,10 +195,10 @@ static struct pv_entry *pvinit; /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1 = 0, *ptmmap; +pt_entry_t *CMAP1 = NULL, *ptmmap; caddr_t CADDR1 = 0, ptvmmap = 0; static pt_entry_t *msgbufmap; -struct msgbuf *msgbufp=0; +struct msgbuf *msgbufp=NULL; /* * Crashdump maps. diff --git a/sys/platform/vkernel/i386/db_interface.c b/sys/platform/vkernel/i386/db_interface.c index 627a8a2b11..f7b9225c60 100644 --- a/sys/platform/vkernel/i386/db_interface.c +++ b/sys/platform/vkernel/i386/db_interface.c @@ -24,7 +24,6 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.48.2.1 2000/07/07 00:38:46 obrien Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/db_interface.c,v 1.3 2007/01/09 00:20:17 dillon Exp $ */ /* @@ -51,7 +50,7 @@ #include -static jmp_buf *db_nofault = 0; +static jmp_buf *db_nofault = NULL; extern jmp_buf db_jmpbuf; extern void gdb_handle_exception (db_regs_t *, int, int); @@ -109,7 +108,7 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) if (db_nofault) { jmp_buf *no_fault = db_nofault; - db_nofault = 0; + db_nofault = NULL; longjmp(*no_fault, 1); } } @@ -216,7 +215,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *data++ = *src++; - db_nofault = 0; + db_nofault = NULL; } /* @@ -269,7 +268,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *dst++ = *data++; - db_nofault = 0; + db_nofault = NULL; #if 0 if (ptep0) { diff --git a/sys/platform/vkernel/i386/db_trace.c b/sys/platform/vkernel/i386/db_trace.c index e6872b1162..8501d0f886 100644 --- a/sys/platform/vkernel/i386/db_trace.c +++ b/sys/platform/vkernel/i386/db_trace.c @@ -379,7 +379,7 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, } db_nextframe(&frame, &callpc); - if (frame == 0) + if (frame == NULL) break; } } diff --git a/sys/platform/vkernel/platform/pmap.c b/sys/platform/vkernel/platform/pmap.c index 7ca3a0eb52..0335d523dd 100644 --- a/sys/platform/vkernel/platform/pmap.c +++ b/sys/platform/vkernel/platform/pmap.c @@ -2965,7 +2965,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr) lwkt_gettoken(&vm_token); ptep = pmap_pte(pmap, addr); - if (ptep == 0) { + if (ptep == NULL) { lwkt_reltoken(&vm_token); return 0; } diff --git a/sys/platform/vkernel64/platform/init.c b/sys/platform/vkernel64/platform/init.c index e6df1f37bb..c6d2c09241 100644 --- a/sys/platform/vkernel64/platform/init.c +++ b/sys/platform/vkernel64/platform/init.c @@ -30,8 +30,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $DragonFly: src/sys/platform/vkernel/platform/init.c,v 1.56 2008/05/27 07:48:00 dillon Exp $ */ #include @@ -526,7 +524,7 @@ init_kern_memory(void) /* NOT REACHED */ } - firstfree = 0; + firstfree = NULL; pmap_bootstrap((vm_paddr_t *)&firstfree, (int64_t)base); mcontrol(base, KERNEL_KVA_SIZE, MADV_SETMAP, diff --git a/sys/platform/vkernel64/platform/pmap.c b/sys/platform/vkernel64/platform/pmap.c index e47d2c7339..dc26e74f51 100644 --- a/sys/platform/vkernel64/platform/pmap.c +++ b/sys/platform/vkernel64/platform/pmap.c @@ -160,7 +160,7 @@ static struct pv_entry *pvinit; /* * All those kernel PT submaps that BSD is so fond of */ -pt_entry_t *CMAP1 = 0, *ptmmap; +pt_entry_t *CMAP1 = NULL, *ptmmap; caddr_t CADDR1 = 0; static pt_entry_t *msgbufmap; diff --git a/sys/platform/vkernel64/x86_64/db_interface.c b/sys/platform/vkernel64/x86_64/db_interface.c index 3ee8c104a3..4bed2ebf86 100644 --- a/sys/platform/vkernel64/x86_64/db_interface.c +++ b/sys/platform/vkernel64/x86_64/db_interface.c @@ -55,7 +55,6 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.48.2.1 2000/07/07 00:38:46 obrien Exp $ - * $DragonFly: src/sys/platform/pc64/amd64/db_interface.c,v 1.3 2008/08/29 17:07:10 dillon Exp $ */ /* @@ -81,7 +80,7 @@ #include -static jmp_buf *db_nofault = 0; +static jmp_buf *db_nofault = NULL; extern jmp_buf db_jmpbuf; extern void gdb_handle_exception (db_regs_t *, int, int); @@ -139,7 +138,7 @@ kdb_trap(int type, int code, struct x86_64_saved_state *regs) if (db_nofault) { jmp_buf *no_fault = db_nofault; - db_nofault = 0; + db_nofault = NULL; longjmp(*no_fault, 1); } } @@ -245,7 +244,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *data++ = *src++; - db_nofault = 0; + db_nofault = NULL; } /* @@ -298,7 +297,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *data) while (size-- > 0) *dst++ = *data++; - db_nofault = 0; + db_nofault = NULL; #if 0 if (ptep0) { diff --git a/sys/platform/vkernel64/x86_64/db_trace.c b/sys/platform/vkernel64/x86_64/db_trace.c index 4ff087a10a..79a4636ec3 100644 --- a/sys/platform/vkernel64/x86_64/db_trace.c +++ b/sys/platform/vkernel64/x86_64/db_trace.c @@ -437,7 +437,7 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, } db_nextframe(&frame, &callpc); - if (frame == 0) + if (frame == NULL) break; } } diff --git a/sys/vfs/hpfs/hpfs_vfsops.c b/sys/vfs/hpfs/hpfs_vfsops.c index 27df4b0473..0bf4dc8d0c 100644 --- a/sys/vfs/hpfs/hpfs_vfsops.c +++ b/sys/vfs/hpfs/hpfs_vfsops.c @@ -120,7 +120,7 @@ hpfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) int error; struct vnode *devvp; struct hpfs_args args; - struct hpfsmount *hpmp = 0; + struct hpfsmount *hpmp = NULL; struct nlookupdata nd; dprintf(("hpfs_mount():\n")); diff --git a/sys/vfs/isofs/cd9660/cd9660_lookup.c b/sys/vfs/isofs/cd9660/cd9660_lookup.c index 4f480a6eec..219f2ec810 100644 --- a/sys/vfs/isofs/cd9660/cd9660_lookup.c +++ b/sys/vfs/isofs/cd9660/cd9660_lookup.c @@ -39,7 +39,6 @@ * * @(#)cd9660_lookup.c 8.2 (Berkeley) 1/23/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_lookup.c,v 1.23.2.2 2001/11/04 06:19:47 dillon Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_lookup.c,v 1.25 2008/06/19 23:27:39 dillon Exp $ */ #include @@ -98,7 +97,7 @@ cd9660_lookup(struct vop_old_lookup_args *ap) struct iso_node *dp; /* inode for directory being searched */ struct iso_mnt *imp; /* file system that directory is in */ struct buf *bp; /* a buffer of directory entries */ - struct iso_directory_record *ep = 0;/* the current directory entry */ + struct iso_directory_record *ep = NULL;/* the current directory entry */ int entryoffsetinblock; /* offset of ep in bp's buffer */ int saveoffset = 0; /* offset of last directory entry in dir */ int numdirpasses; /* strategy for directory search */ diff --git a/sys/vfs/isofs/cd9660/cd9660_vfsops.c b/sys/vfs/isofs/cd9660/cd9660_vfsops.c index 1cfed1cbae..512adc7f6e 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vfsops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vfsops.c @@ -190,7 +190,7 @@ cd9660_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) size_t size; int error; mode_t accessmode; - struct iso_mnt *imp = 0; + struct iso_mnt *imp = NULL; struct nlookupdata nd; if ((mp->mnt_flag & (MNT_ROOTFS|MNT_UPDATE)) == MNT_ROOTFS) { @@ -281,7 +281,7 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct iso_args *argp) int iso_bsize; int iso_blknum; int joliet_level; - struct iso_volume_descriptor *vdp = 0; + struct iso_volume_descriptor *vdp = NULL; struct iso_primary_descriptor *pri = NULL; struct iso_sierra_primary_descriptor *pri_sierra = NULL; struct iso_supplementary_descriptor *sup = NULL; @@ -802,7 +802,7 @@ again: } #endif } else - bp = 0; + bp = NULL; ip->i_mnt = imp; ip->i_devvp = imp->im_devvp; diff --git a/sys/vfs/msdosfs/msdosfs_conv.c b/sys/vfs/msdosfs/msdosfs_conv.c index 3d35c983f6..9ceb3545a6 100644 --- a/sys/vfs/msdosfs/msdosfs_conv.c +++ b/sys/vfs/msdosfs/msdosfs_conv.c @@ -712,7 +712,7 @@ unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen, struct msdo * ignores all dots before extension, and use all * chars as filename except for dots. */ - dp = dp1 = 0; + dp = dp1 = NULL; for (cp = un + 1, i = unlen - 1; --i >= 0;) { switch (*cp++) { case '.': @@ -724,7 +724,7 @@ unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen, struct msdo default: if (dp1) dp = dp1; - dp1 = 0; + dp1 = NULL; break; } } diff --git a/sys/vfs/msdosfs/msdosfs_fat.c b/sys/vfs/msdosfs/msdosfs_fat.c index 8ce257a9d3..a7f9ee4a77 100644 --- a/sys/vfs/msdosfs/msdosfs_fat.c +++ b/sys/vfs/msdosfs/msdosfs_fat.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_fat.c,v 1.23 2000/01/27 14:43:06 nyan Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_fat.c,v 1.11 2006/12/23 00:41:29 swildner Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -282,12 +281,12 @@ fc_lookup(struct denode *dep, u_long findcn, u_long *frcnp, u_long *fsrcnp) { int i; u_long cn; - struct fatcache *closest = 0; + struct fatcache *closest = NULL; for (i = 0; i < FC_SIZE; i++) { cn = dep->de_fc[i].fc_frcn; if (cn != FCE_EMPTY && cn <= findcn) { - if (closest == 0 || cn > closest->fc_frcn) + if (closest == NULL || cn > closest->fc_frcn) closest = &dep->de_fc[i]; } } diff --git a/sys/vfs/msdosfs/msdosfs_lookup.c b/sys/vfs/msdosfs/msdosfs_lookup.c index 85720a9065..5f21004e5b 100644 --- a/sys/vfs/msdosfs/msdosfs_lookup.c +++ b/sys/vfs/msdosfs/msdosfs_lookup.c @@ -1,5 +1,4 @@ /* $FreeBSD: src/sys/msdosfs/msdosfs_lookup.c,v 1.30.2.1 2000/11/03 15:55:39 bp Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_lookup.c,v 1.21 2006/12/23 00:41:29 swildner Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */ /*- @@ -107,7 +106,7 @@ msdosfs_lookup(struct vop_old_lookup_args *ap) struct denode *dp; struct denode *tdp; struct msdosfsmount *pmp; - struct buf *bp = 0; + struct buf *bp = NULL; struct direntry *dep = NULL; u_char dosfilename[12]; int flags = cnp->cn_flags; @@ -405,7 +404,7 @@ found: * in a deadlock. */ brelse(bp); - bp = 0; + bp = NULL; foundroot: /* diff --git a/sys/vfs/nfs/nfs_node.c b/sys/vfs/nfs/nfs_node.c index edfb01667f..5b36ed473a 100644 --- a/sys/vfs/nfs/nfs_node.c +++ b/sys/vfs/nfs/nfs_node.c @@ -177,7 +177,7 @@ loop: * Validate that we did not race another nfs_nget() due to blocking * here and there. */ - for (np2 = nhpp->lh_first; np2 != 0; np2 = np2->n_hash.le_next) { + for (np2 = nhpp->lh_first; np2 != NULL; np2 = np2->n_hash.le_next) { if (mntp != NFSTOV(np2)->v_mount || np2->n_fhsize != fhsize || bcmp((caddr_t)fhp, (caddr_t)np2->n_fhp, fhsize)) { continue; @@ -311,7 +311,7 @@ loop: * Validate that we did not race another nfs_nget() due to blocking * here and there. */ - for (np2 = nhpp->lh_first; np2 != 0; np2 = np2->n_hash.le_next) { + for (np2 = nhpp->lh_first; np2 != NULL; np2 = np2->n_hash.le_next) { if (mntp != NFSTOV(np2)->v_mount || np2->n_fhsize != fhsize || bcmp((caddr_t)fhp, (caddr_t)np2->n_fhp, fhsize)) { continue; diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index 4cad5adb3c..b93350cf74 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -1614,7 +1614,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp, struct timeval ktvin, ktvout; for (nuidp = NUIDHASH(slp, nd->nd_cr.cr_uid)->lh_first; - nuidp != 0; nuidp = nuidp->nu_hash.le_next) { + nuidp != NULL; nuidp = nuidp->nu_hash.le_next) { if (nuidp->nu_cr.cr_uid == nd->nd_cr.cr_uid && (!nd->nd_nam2 || netaddr_match(NU_NETFAM(nuidp), &nuidp->nu_haddr, nd->nd_nam2))) @@ -2427,7 +2427,7 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header) tvin.tv_usec = *tl; for (nuidp = NUIDHASH(nfsd->nfsd_slp,nickuid)->lh_first; - nuidp != 0; nuidp = nuidp->nu_hash.le_next) { + nuidp != NULL; nuidp = nuidp->nu_hash.le_next) { if (nuidp->nu_cr.cr_uid == nickuid && (!nd->nd_nam2 || netaddr_match(NU_NETFAM(nuidp), diff --git a/sys/vfs/nfs/nfs_srvcache.c b/sys/vfs/nfs/nfs_srvcache.c index 3436ff73cf..165ff0d1ff 100644 --- a/sys/vfs/nfs/nfs_srvcache.c +++ b/sys/vfs/nfs/nfs_srvcache.c @@ -185,7 +185,7 @@ nfsrv_getcache(struct nfsrv_descript *nd, struct nfssvc_sock *slp, lwkt_gettoken(&srvcache_token); loop: - for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != 0; + for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != NULL; rp = rp->rc_hash.le_next) { if (nd->nd_retxid == rp->rc_xid && nd->nd_procnum == rp->rc_proc && netaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) { @@ -299,7 +299,7 @@ nfsrv_updatecache(struct nfsrv_descript *nd, int repvalid, struct mbuf *repmbuf) lwkt_gettoken(&srvcache_token); loop: - for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != 0; + for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != NULL; rp = rp->rc_hash.le_next) { if (nd->nd_retxid == rp->rc_xid && nd->nd_procnum == rp->rc_proc && netaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) { diff --git a/sys/vfs/nfs/nfs_syscalls.c b/sys/vfs/nfs/nfs_syscalls.c index bc87abd51e..c3d5c8a364 100644 --- a/sys/vfs/nfs/nfs_syscalls.c +++ b/sys/vfs/nfs/nfs_syscalls.c @@ -1065,7 +1065,7 @@ nfs_getnickauth(struct nfsmount *nmp, struct ucred *cred, char **auth_str, panic("nfs_getnickauth verf too small"); #endif for (nuidp = NMUIDHASH(nmp, cred->cr_uid)->lh_first; - nuidp != 0; nuidp = nuidp->nu_hash.le_next) { + nuidp != NULL; nuidp = nuidp->nu_hash.le_next) { if (nuidp->nu_cr.cr_uid == cred->cr_uid) break; } diff --git a/sys/vfs/portal/portal_vnops.c b/sys/vfs/portal/portal_vnops.c index fc0c000c9b..0a2673902f 100644 --- a/sys/vfs/portal/portal_vnops.c +++ b/sys/vfs/portal/portal_vnops.c @@ -112,7 +112,7 @@ portal_lookup(struct vop_old_lookup_args *ap) char *pname = cnp->cn_nameptr; struct portalnode *pt; int error; - struct vnode *fvp = 0; + struct vnode *fvp = NULL; char *path; int size; @@ -174,7 +174,7 @@ portal_connect(struct socket *so, struct socket *so2) struct unpcb *unp2; struct unpcb *unp3; - if (so2 == 0) + if (so2 == NULL) return (ECONNREFUSED); if (so->so_type != so2->so_type) @@ -183,7 +183,7 @@ portal_connect(struct socket *so, struct socket *so2) if ((so2->so_options & SO_ACCEPTCONN) == 0) return (ECONNREFUSED); - if ((so3 = sonewconn(so2, 0)) == 0) + if ((so3 = sonewconn(so2, 0)) == NULL) return (ECONNREFUSED); unp2 = so2->so_pcb; @@ -203,7 +203,7 @@ portal_connect(struct socket *so, struct socket *so2) static int portal_open(struct vop_open_args *ap) { - struct socket *so = 0; + struct socket *so = NULL; struct portalnode *pt; struct thread *td = curthread; struct vnode *vp = ap->a_vp; @@ -211,7 +211,7 @@ portal_open(struct vop_open_args *ap) struct iovec aiov[2]; struct sockbuf sio; int res; - struct mbuf *cm = 0; + struct mbuf *cm = NULL; struct cmsghdr *cmsg; int newfds; int *ip; diff --git a/sys/vfs/procfs/procfs_status.c b/sys/vfs/procfs/procfs_status.c index 0b351d7e24..105a732c16 100644 --- a/sys/vfs/procfs/procfs_status.c +++ b/sys/vfs/procfs/procfs_status.c @@ -213,11 +213,11 @@ procfs_docmdline(struct proc *curp, struct lwp *lp, struct pfsnode *pfs, ) { bp = p->p_args->ar_args; buflen = p->p_args->ar_length; - buf = 0; + buf = NULL; } else if (p != curp) { bp = p->p_comm; buflen = MAXCOMLEN; - buf = 0; + buf = NULL; } else { buflen = 256; buf = kmalloc(buflen + 1, M_TEMP, M_WAITOK); diff --git a/sys/vfs/udf/udf_vfsops.c b/sys/vfs/udf/udf_vfsops.c index e44c69a67f..a2fc007c89 100644 --- a/sys/vfs/udf/udf_vfsops.c +++ b/sys/vfs/udf/udf_vfsops.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.16 2003/11/05 06:56:08 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.28 2008/09/17 21:44:25 dillon Exp $ */ /* udf_vfsops.c */ @@ -133,7 +132,7 @@ udf_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) { struct vnode *devvp; /* vnode of the mount device */ struct udf_args args; - struct udf_mnt *imp = 0; + struct udf_mnt *imp = NULL; size_t size; int error; struct nlookupdata nd; diff --git a/sys/vfs/ufs/ffs_alloc.c b/sys/vfs/ufs/ffs_alloc.c index 27938ffa4e..afcde72eba 100644 --- a/sys/vfs/ufs/ffs_alloc.c +++ b/sys/vfs/ufs/ffs_alloc.c @@ -32,7 +32,6 @@ * * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 * $FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.64.2.2 2001/09/21 19:15:21 dillon Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_alloc.c,v 1.27 2006/12/29 17:10:20 swildner Exp $ */ #include "opt_quota.h" @@ -180,7 +179,7 @@ ffs_realloccg(struct inode *ip, ufs_daddr_t lbprev, ufs_daddr_t bpref, int cg, request, error; ufs_daddr_t bprev, bno; - *bpp = 0; + *bpp = NULL; fs = ip->i_fs; #ifdef DIAGNOSTIC if ((uint)osize > fs->fs_bsize || fragoff(fs, osize) != 0 || @@ -356,7 +355,7 @@ ffs_reallocblks(struct vop_reallocblks_args *ap) struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - ufs_daddr_t *bap, *sbap, *ebap = 0; + ufs_daddr_t *bap, *sbap, *ebap = NULL; struct cluster_save *buflist; ufs_daddr_t start_lbn, end_lbn, soff, newblk, blkno; #ifdef DIAGNOSTIC diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index ad33f3572b..93855cc98d 100644 --- a/sys/vfs/ufs/ffs_softdep.c +++ b/sys/vfs/ufs/ffs_softdep.c @@ -718,7 +718,7 @@ process_worklist_item(struct mount *matchmnt, int flags) if (vp == NULL || !vn_islocked(vp)) break; } - if (wk == 0) { + if (wk == NULL) { FREE_LOCK(&lk); return (0); } @@ -1908,7 +1908,7 @@ softdep_setup_freeblocks(struct inode *ip, off_t length) * any duplicate freefrag structures, then purge the merged list. */ merge_inode_lists(inodedep); - while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != 0) + while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != NULL) free_allocdirect(&inodedep->id_inoupdt, adp, 1); FREE_LOCK(&lk); bdwrite(bp); @@ -2026,7 +2026,7 @@ deallocate_dependencies(struct buf *bp, struct inodedep *inodedep) panic("deallocate_dependencies: already gone"); } indirdep->ir_state |= GOINGAWAY; - while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != 0) + while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != NULL) free_allocindir(aip, inodedep); if (bp->b_bio1.bio_offset >= 0 || bp->b_bio2.bio_offset != indirdep->ir_savebp->b_bio1.bio_offset) { @@ -2049,7 +2049,7 @@ deallocate_dependencies(struct buf *bp, struct inodedep *inodedep) while ((dap = LIST_FIRST(&pagedep->pd_diraddhd[i]))) free_diradd(dap); - while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != 0) + while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) free_diradd(dap); /* * Copy any directory remove dependencies to the list @@ -3513,7 +3513,7 @@ softdep_disk_write_complete(struct buf *bp) indirdep->ir_saveddata = 0; indirdep->ir_state &= ~UNDONE; indirdep->ir_state |= ATTACHED; - while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) { + while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != NULL) { handle_allocindir_partdone(aip); if (aip == LIST_FIRST(&indirdep->ir_donehd)) { lk.lkt_held = NOHOLDER; diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index 7d9812ecb7..ecd49b5936 100644 --- a/sys/vfs/ufs/ffs_vfsops.c +++ b/sys/vfs/ufs/ffs_vfsops.c @@ -138,7 +138,7 @@ ffs_mount(struct mount *mp, /* mount struct pointer */ struct vnode *devvp; struct ufs_args args; - struct ufsmount *ump = 0; + struct ufsmount *ump = NULL; struct fs *fs; int flags, ronly = 0; mode_t accessmode; diff --git a/sys/vfs/union/union_subr.c b/sys/vfs/union/union_subr.c index cb692c0683..c715c7cc1e 100644 --- a/sys/vfs/union/union_subr.c +++ b/sys/vfs/union/union_subr.c @@ -329,7 +329,7 @@ union_allocvp(struct vnode **vpp, int docache) { int error; - struct union_node *un = 0; + struct union_node *un = NULL; struct union_mount *um = MOUNTTOUNIONMOUNT(mp); struct thread *td = (cnp) ? cnp->cn_td : curthread; /* XXX */ int hash = 0; @@ -358,7 +358,7 @@ union_allocvp(struct vnode **vpp, loop: if (!docache) { - un = 0; + un = NULL; } else for (try = 0; try < 3; try++) { switch (try) { case 0: @@ -383,7 +383,7 @@ loop: while (union_list_lock(hash)) continue; - for (un = unhead[hash].lh_first; un != 0; + for (un = unhead[hash].lh_first; un != NULL; un = un->un_cache.le_next) { if ((un->un_lowervp == lowervp || un->un_lowervp == NULLVP) && diff --git a/sys/vfs/union/union_vfsops.c b/sys/vfs/union/union_vfsops.c index 80f53d2de4..6902c8c0c6 100644 --- a/sys/vfs/union/union_vfsops.c +++ b/sys/vfs/union/union_vfsops.c @@ -36,7 +36,6 @@ * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 * $FreeBSD: src/sys/miscfs/union/union_vfsops.c,v 1.39.2.2 2001/10/25 19:18:53 dillon Exp $ - * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.29 2006/12/23 00:41:30 swildner Exp $ */ /* @@ -78,10 +77,10 @@ union_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) struct union_args args; struct vnode *lowerrootvp = NULLVP; struct vnode *upperrootvp = NULLVP; - struct union_mount *um = 0; - struct ucred *cred = 0; + struct union_mount *um = NULL; + struct ucred *cred = NULL; struct nlookupdata nd; - char *cp = 0; + char *cp = NULL; int len; u_int size; diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index 842dd26957..dcc59ec610 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -14,7 +14,6 @@ * John S. Dyson. * * $FreeBSD: src/sys/vm/vm_zone.c,v 1.30.2.6 2002/10/10 19:50:16 dillon Exp $ - * $DragonFly: src/sys/vm/vm_zone.c,v 1.28 2008/01/23 17:35:48 nth Exp $ */ #include @@ -80,7 +79,7 @@ retry: ("zitems_pcpu unexpectedly NULL")); if (((void **)item)[1] != (void *)ZENTRY_FREE) zerror(ZONE_ERROR_NOTFREE); - ((void **)item)[1] = 0; + ((void **)item)[1] = NULL; #endif z->zitems_pcpu[gd->gd_cpuid] = ((void **) item)[0]; --z->zfreecnt_pcpu[gd->gd_cpuid]; @@ -603,7 +602,7 @@ zget(vm_zone_t z) #ifdef INVARIANTS if (((void **)item)[1] != (void *)ZENTRY_FREE) zerror(ZONE_ERROR_NOTFREE); - ((void **) item)[1] = 0; + ((void **) item)[1] = NULL; #endif z->zfreecnt--; z->znalloc++; -- 2.41.0