kernel: Remove some bogus casts of NULL to something.
authorSascha Wildner <saw@online.de>
Tue, 1 May 2012 17:48:16 +0000 (19:48 +0200)
committerSascha Wildner <saw@online.de>
Tue, 1 May 2012 17:48:36 +0000 (19:48 +0200)
12 files changed:
sys/dev/atm/hea/eni_buffer.c
sys/dev/atm/hea/eni_init.c
sys/dev/atm/hea/eni_vcm.c
sys/dev/disk/sym/sym_hipd.c
sys/dev/raid/amr/amr.c
sys/dev/raid/twa/tw_osl_freebsd.c
sys/dev/raid/twe/twe_freebsd.c
sys/kern/subr_prf.c
sys/net/pf/pf.c
sys/net/pf/pf_osfp.c
sys/netinet/ip6.h
sys/vfs/hpfs/hpfs_vfsops.c

index ef2cf81..126f524 100644 (file)
@@ -24,7 +24,6 @@
  * notice must be reproduced on all copies.
  *
  *     @(#) $FreeBSD: src/sys/dev/hea/eni_buffer.c,v 1.5 1999/08/28 00:41:43 peter Exp $
- *     @(#) $DragonFly: src/sys/dev/atm/hea/eni_buffer.c,v 1.7 2008/03/01 22:03:13 swildner Exp $
  */
 
 /*
@@ -210,7 +209,7 @@ eni_allocate_buffer(Eni_unit *eup, u_long *size)
                /* Indicate 0 bytes allocated */
                *size = 0;
                /* Return NULL buffer */
-               return ( (caddr_t)NULL );
+               return ( NULL );
        }
 
        /*
@@ -326,7 +325,7 @@ eni_allocate_buffer(Eni_unit *eup, u_long *size)
                /* No buffer to return - indicate zero length */
                *size = 0;
                /* Return NULL buffer */
-               return ( (caddr_t)NULL );
+               return ( NULL );
        }
 }
 
index 3c13362..02f2e08 100644 (file)
@@ -24,7 +24,6 @@
  * notice must be reproduced on all copies.
  *
  *     @(#) $FreeBSD: src/sys/dev/hea/eni_init.c,v 1.3 1999/08/28 00:41:44 peter Exp $
- *     @(#) $DragonFly: src/sys/dev/atm/hea/eni_init.c,v 1.5 2008/03/01 22:03:13 swildner Exp $
  */
 
 /*
@@ -73,7 +72,7 @@ eni_init(Eni_unit *eup)
        words = ( eup->eu_ramsize > MAX_CLIENT_RAM * ENI_BUF_PGSZ ?
                TX_LARGE_BSIZE : TX_SMALL_BSIZE ) * ENI_BUF_PGSZ;
        if ( ( eup->eu_txbuf = eni_allocate_buffer ( eup, &words ) ) ==
-           (caddr_t)NULL ) {
+           NULL ) {
                return ENOMEM;
        } 
        eup->eu_txsize = words >> 2;            /* Bytes to words */
index 76d975a..a82dd88 100644 (file)
@@ -24,7 +24,6 @@
  * notice must be reproduced on all copies.
  *
  *     @(#) $FreeBSD: src/sys/dev/hea/eni_vcm.c,v 1.3 1999/08/28 00:41:47 peter Exp $
- *     @(#) $DragonFly: src/sys/dev/atm/hea/eni_vcm.c,v 1.7 2008/03/01 22:03:13 swildner Exp $
  */
 
 /*
@@ -153,7 +152,7 @@ eni_openvcc(Cmn_unit *cup, Cmn_vcc *cvp)
                        RX_CLIENT_BSIZE * ENI_BUF_PGSZ;
 
        if ( ( evp->ev_rxbuf = eni_allocate_buffer ( eup, (u_long *)&size ) )
-           == (caddr_t)NULL ) {
+           == NULL ) {
                return ( ENOMEM );
        }
        evp->ev_rxpos = 0;
index 6e08404..54f8f72 100644 (file)
@@ -6301,7 +6301,7 @@ static    ccb_p sym_get_ccb (hcb_p np, u_char tn, u_char ln, u_char tag_order)
        lcb_p lp = sym_lp(np, tp, ln);
        u_short tag = NO_TAG;
        SYM_QUEHEAD *qp;
-       ccb_p cp = (ccb_p) NULL;
+       ccb_p cp = NULL;
 
        /*
         *  Look for a free CCB
index 67d171f..09b616e 100644 (file)
@@ -410,7 +410,7 @@ amr_free(struct amr_softc *sc)
     }
 
     /* destroy control device */
-    if(sc->amr_dev_t != (struct cdev *)NULL)
+    if(sc->amr_dev_t != NULL)
            destroy_dev(sc->amr_dev_t);
     dev_ops_remove_minor(&amr_ops, device_get_unit(sc->amr_dev));
 
index 971928d..20a6b4f 100644 (file)
@@ -812,7 +812,7 @@ tw_osli_free_resources(struct twa_softc *sc)
        dev_ops_remove_minor(&twa_ops, device_get_unit(sc->bus_dev));
 
        /* Destroy the control device. */
-       if (sc->ctrl_dev != (struct cdev *)NULL)
+       if (sc->ctrl_dev != NULL)
                destroy_dev(sc->ctrl_dev);
 
        if ((error = sysctl_ctx_free(&sc->sysctl_ctxt)))
index 40b39f9..7926a71 100644 (file)
@@ -423,7 +423,7 @@ twe_free(struct twe_softc *sc)
     dev_ops_remove_minor(&twe_ops, device_get_unit(sc->twe_dev));
 
     /* destroy control device */
-    if (sc->twe_dev_t != (cdev_t)NULL)
+    if (sc->twe_dev_t != NULL)
        destroy_dev(sc->twe_dev_t);
 
     sysctl_ctx_free(&sc->sysctl_ctx);
index aff13ce..bb1841e 100644 (file)
@@ -160,7 +160,7 @@ tprintf_open(struct proc *p)
                sess_hold(p->p_session);
                return ((tpr_t) p->p_session);
        }
-       return ((tpr_t) NULL);
+       return (NULL);
 }
 
 void
index 3114fc0..1fb85c1 100644 (file)
@@ -1876,8 +1876,7 @@ pf_send_tcp(const struct pf_rule *r, sa_family_t af,
                        e->ether_type = eh->ether_type;
                        /* XXX_IMPORT: later */
                        lwkt_reltoken(&pf_token);
-                       ip_output(m, (void *)NULL, &ro, 0,
-                           (void *)NULL, (void *)NULL);
+                       ip_output(m, NULL, &ro, 0, NULL, NULL);
                        lwkt_gettoken(&pf_token);
                }
                break;
index 13963bc..02b5c1b 100644 (file)
@@ -93,9 +93,9 @@ pf_osfp_fingerprint(struct pf_pdesc *pd, struct mbuf *m, int off,
 
        if (pd->af == PF_INET) {
                ip = mtod(m, struct ip *);
-               ip6 = (struct ip6_hdr *)NULL;
+               ip6 = NULL;
        } else {
-               ip = (struct ip *)NULL;
+               ip = NULL;
                ip6 = mtod(m, struct ip6_hdr *);
        }
        if (!pf_pull_hdr(m, off, hdr, tcp->th_off << 2, NULL, NULL,
index d22cd81..6e64fb2 100644 (file)
@@ -334,7 +334,7 @@ do {                                                                        \
                                panic("m_pulldown malfunction");        \
                        (val) = (typ)(mtod(t, caddr_t) + tmp);          \
                } else {                                                \
-                       (val) = (typ)NULL;                              \
+                       (val) = NULL;                                   \
                        (m) = NULL;                                     \
                }                                                       \
        }                                                               \
@@ -352,7 +352,7 @@ do {                                                                        \
                                panic("m_pulldown malfunction");        \
                        (val) = (typ)mtod(t, caddr_t);                  \
                } else {                                                \
-                       (val) = (typ)NULL;                              \
+                       (val) = NULL;                                   \
                        (m) = NULL;                                     \
                }                                                       \
        }                                                               \
index 0bf4dc8..e77e432 100644 (file)
@@ -330,7 +330,7 @@ hpfs_mountfs(struct vnode *devvp, struct mount *mp, struct hpfs_args *argsp)
 failed:
        if (bp)
                brelse (bp);
-       mp->mnt_data = (qaddr_t)NULL;
+       mp->mnt_data = NULL;
        dev->si_mountpoint = NULL;
        VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE);
        return (error);