Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys NULL does not need a cast



details:   https://anonhg.NetBSD.org/src/rev/197d8011eff3
branches:  trunk
changeset: 769116:197d8011eff3
user:      plunky <plunky%NetBSD.org@localhost>
date:      Wed Aug 31 18:31:02 2011 +0000

description:
NULL does not need a cast

diffstat:

 sys/coda/coda_subr.c             |   6 ++--
 sys/compat/ndis/subr_ntoskrnl.c  |   8 +++---
 sys/dev/pci/twa.c                |  10 ++++----
 sys/dev/raidframe/rf_aselect.c   |   8 +++---
 sys/dev/raidframe/rf_cvscan.c    |  50 +++++++++++++++++++--------------------
 sys/dev/raidframe/rf_decluster.c |   6 ++--
 sys/dev/raidframe/rf_reconmap.c  |   6 ++--
 sys/fs/ntfs/ntfs_subr.c          |   6 ++--
 sys/kern/kern_drvctl.c           |   6 ++--
 sys/kern/kern_malloc.c           |   6 ++--
 sys/kern/subr_autoconf.c         |   8 +++---
 sys/kern/uipc_mbuf.c             |   8 +++---
 sys/kern/uipc_socket2.c          |   6 ++--
 sys/miscfs/fifofs/fifo_vnops.c   |   6 ++--
 sys/netatalk/ddp_input.c         |   8 +++---
 sys/netinet/ip_input.c           |   6 ++--
 sys/netinet/ip_mroute.c          |  15 ++++-------
 sys/netinet/tcp_input.c          |   6 ++--
 sys/netinet/tcp_timer.c          |   8 +++---
 sys/netinet6/icmp6.c             |   9 +++----
 sys/netinet6/in6_pcb.c           |   6 ++--
 sys/netinet6/ip6_mroute.c        |   7 ++---
 sys/netinet6/mld6.c              |   6 ++--
 sys/netinet6/udp6_output.c       |   7 ++---
 sys/netipsec/ipsec_output.c      |   6 ++--
 sys/netipsec/xform_esp.c         |   6 ++--
 sys/netiso/tp_inet.c             |   6 ++--
 sys/netsmb/smb_trantcp.c         |   6 ++--
 28 files changed, 117 insertions(+), 125 deletions(-)

diffs (truncated from 1015 to 300 lines):

diff -r 7b5dbbd73321 -r 197d8011eff3 sys/coda/coda_subr.c
--- a/sys/coda/coda_subr.c      Wed Aug 31 17:03:17 2011 +0000
+++ b/sys/coda/coda_subr.c      Wed Aug 31 18:31:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_subr.c,v 1.24 2007/10/10 20:42:21 ad Exp $        */
+/*     $NetBSD: coda_subr.c,v 1.25 2011/08/31 18:31:02 plunky Exp $    */
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_subr.c,v 1.24 2007/10/10 20:42:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_subr.c,v 1.25 2011/08/31 18:31:02 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -157,7 +157,7 @@
            } else {
                CNODE_NEXT(ptrprev) = CNODE_NEXT(ptr);
            }
-           CNODE_NEXT(cp) = (struct cnode *)NULL;
+           CNODE_NEXT(cp) = NULL;
 
            return;
        }
diff -r 7b5dbbd73321 -r 197d8011eff3 sys/compat/ndis/subr_ntoskrnl.c
--- a/sys/compat/ndis/subr_ntoskrnl.c   Wed Aug 31 17:03:17 2011 +0000
+++ b/sys/compat/ndis/subr_ntoskrnl.c   Wed Aug 31 18:31:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_ntoskrnl.c,v 1.20 2011/07/17 20:54:50 joerg Exp $ */
+/*     $NetBSD: subr_ntoskrnl.c,v 1.21 2011/08/31 18:31:02 plunky Exp $        */
 
 /*-
  * Copyright (c) 2003
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.43.2.5 2005/03/31 04:24:36 wpaul Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: subr_ntoskrnl.c,v 1.20 2011/07/17 20:54:50 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_ntoskrnl.c,v 1.21 2011/08/31 18:31:02 plunky Exp $");
 #endif
 
 #ifdef __FreeBSD__
@@ -2108,7 +2108,7 @@
 atoi(const char *str)
 {
 #ifdef __FreeBSD__
-       return (int)strtol(str, (char **)NULL, 10);
+       return (int)strtol(str, NULL, 10);
 #else
     int n;
 
@@ -2123,7 +2123,7 @@
 atol(const char *str)
 {
 #ifdef __FreeBSD__
-       return strtol(str, (char **)NULL, 10);
+       return strtol(str, NULL, 10);
 #else
      long n;
 
diff -r 7b5dbbd73321 -r 197d8011eff3 sys/dev/pci/twa.c
--- a/sys/dev/pci/twa.c Wed Aug 31 17:03:17 2011 +0000
+++ b/sys/dev/pci/twa.c Wed Aug 31 18:31:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: twa.c,v 1.37 2011/05/24 18:28:01 joerg Exp $ */
+/*     $NetBSD: twa.c,v 1.38 2011/08/31 18:31:02 plunky Exp $ */
 /*     $wasabi: twa.c,v 1.27 2006/07/28 18:17:21 wrstuden Exp $        */
 
 /*-
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.37 2011/05/24 18:28:01 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.38 2011/08/31 18:31:02 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -250,7 +250,7 @@
        {0x00FD, "Handler lockup"},
        {0x00FE, "Retrying PCI transfer"},
        {0x00FF, "AEN queue is full"},
-       {0xFFFFFFFF, (char *)NULL}
+       {0xFFFFFFFF, NULL}
 };
 
 /* AEN severity table. */
@@ -260,7 +260,7 @@
        "WARNING",
        "INFO",
        "DEBUG",
-       (char *)NULL
+       NULL
 };
 
 /* Error messages. */
@@ -377,7 +377,7 @@
        {0x025B, "Invalid LBA offset specified in CreateUnit descriptor"},
        {0x025C, "Invalid stripelet size specified in CreateUnit descriptor"},
        {0x0260, "SMART attribute exceeded threshold"},
-       {0xFFFFFFFF, (char *)NULL}
+       {0xFFFFFFFF, NULL}
 };
 
 struct twa_pci_identity {
diff -r 7b5dbbd73321 -r 197d8011eff3 sys/dev/raidframe/rf_aselect.c
--- a/sys/dev/raidframe/rf_aselect.c    Wed Aug 31 17:03:17 2011 +0000
+++ b/sys/dev/raidframe/rf_aselect.c    Wed Aug 31 18:31:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_aselect.c,v 1.26 2009/02/07 20:41:30 oster Exp $    */
+/*     $NetBSD: rf_aselect.c,v 1.27 2011/08/31 18:31:02 plunky Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  *****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_aselect.c,v 1.26 2009/02/07 20:41:30 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_aselect.c,v 1.27 2011/08/31 18:31:02 plunky Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -222,7 +222,7 @@
                                /* check to see if we found a creation func
                                 * for this stripe unit */
 
-                               if (vfple->fn == (RF_VoidFuncPtr) NULL) {
+                               if (vfple->fn == NULL) {
                                        /* could not find creation function
                                         * for stripe unit so, let's see if we
                                         * can find one for each block in the
@@ -375,7 +375,7 @@
                                tmpvfple = failed_stripe->bvfple;
                                for (j = 0, physPtr = asm_p->physInfo; physPtr; physPtr = physPtr->next, j++) {
                                        uFunc = vfple->fn; /* stripeUnitFuncs[stripeNum][j]; */
-                                       if (uFunc == (RF_VoidFuncPtr) NULL) {
+                                       if (uFunc == NULL) {
                                                /* use bailout functions for
                                                 * this stripe unit */
                                                for (k = 0; k < physPtr->numSector; k++) {
diff -r 7b5dbbd73321 -r 197d8011eff3 sys/dev/raidframe/rf_cvscan.c
--- a/sys/dev/raidframe/rf_cvscan.c     Wed Aug 31 17:03:17 2011 +0000
+++ b/sys/dev/raidframe/rf_cvscan.c     Wed Aug 31 18:31:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_cvscan.c,v 1.15 2006/11/16 01:33:23 christos Exp $  */
+/*     $NetBSD: rf_cvscan.c,v 1.16 2011/08/31 18:31:02 plunky Exp $    */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -35,7 +35,7 @@
  ******************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.15 2006/11/16 01:33:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_cvscan.c,v 1.16 2011/08/31 18:31:02 plunky Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 #include "rf_alloclist.h"
@@ -56,17 +56,17 @@
        long    i, key;
        RF_DiskQueueData_t *tmp;
 
-       if (hdr->left != (RF_DiskQueueData_t *) NULL)
+       if (hdr->left != NULL)
                RF_ASSERT(hdr->left->sectorOffset < hdr->cur_block);
        for (key = hdr->cur_block, i = 0, tmp = hdr->left;
-           tmp != (RF_DiskQueueData_t *) NULL;
+           tmp != NULL;
            key = tmp->sectorOffset, i++, tmp = tmp->next)
                RF_ASSERT(tmp->sectorOffset <= key
                    && tmp->priority == hdr->nxt_priority && pri_ok(tmp->priority));
        RF_ASSERT(i == hdr->left_cnt);
 
        for (key = hdr->cur_block, i = 0, tmp = hdr->right;
-           tmp != (RF_DiskQueueData_t *) NULL;
+           tmp != NULL;
            key = tmp->sectorOffset, i++, tmp = tmp->next) {
                RF_ASSERT(key <= tmp->sectorOffset);
                RF_ASSERT(tmp->priority == hdr->nxt_priority);
@@ -75,7 +75,7 @@
        RF_ASSERT(i == hdr->right_cnt);
 
        for (key = hdr->nxt_priority - 1, tmp = hdr->burner;
-           tmp != (RF_DiskQueueData_t *) NULL;
+           tmp != NULL;
            key = tmp->priority, tmp = tmp->next) {
                RF_ASSERT(tmp);
                RF_ASSERT(hdr);
@@ -94,8 +94,7 @@
         * pointed to by the pointer that list_ptr points to * ie., list_ptr
         * is a grandparent of the first entry */
 
-       for (; (*list_ptr) != (RF_DiskQueueData_t *) NULL &&
-           (*list_ptr)->priority > req->priority;
+       for (; (*list_ptr) != NULL && (*list_ptr)->priority > req->priority;
            list_ptr = &((*list_ptr)->next)) {
        }
        req->next = (*list_ptr);
@@ -111,8 +110,7 @@
         * pointed to by the pointer that list_ptr points to * ie., list_ptr
         * is a grandparent of the first entry */
 
-       for (; (*list_ptr) != (RF_DiskQueueData_t *) NULL &&
-
+       for (; (*list_ptr) != NULL &&
            ((order == rf_cvscan_RIGHT && (*list_ptr)->sectorOffset <= req->sectorOffset)
                || (order == rf_cvscan_LEFT && (*list_ptr)->sectorOffset > req->sectorOffset));
            list_ptr = &((*list_ptr)->next)) {
@@ -127,7 +125,7 @@
 ReqDequeue(RF_DiskQueueData_t **list_ptr)
 {
        RF_DiskQueueData_t *ret = (*list_ptr);
-       if ((*list_ptr) != (RF_DiskQueueData_t *) NULL) {
+       if ((*list_ptr) != NULL) {
                (*list_ptr) = (*list_ptr)->next;
        }
        return (ret);
@@ -139,7 +137,7 @@
 ReBalance(RF_CvscanHeader_t *hdr)
 {
        /* DO_CHECK_STATE(hdr); */
-       while (hdr->right != (RF_DiskQueueData_t *) NULL
+       while (hdr->right != NULL
            && hdr->right->sectorOffset < hdr->cur_block) {
                hdr->right_cnt--;
                hdr->left_cnt++;
@@ -154,12 +152,12 @@
 Transfer(RF_DiskQueueData_t **to_list_ptr, RF_DiskQueueData_t **from_list_ptr)
 {
        RF_DiskQueueData_t *gp;
-       for (gp = (*from_list_ptr); gp != (RF_DiskQueueData_t *) NULL;) {
+       for (gp = (*from_list_ptr); gp != NULL;) {
                RF_DiskQueueData_t *p = gp->next;
                PriorityInsert(to_list_ptr, gp);
                gp = p;
        }
-       (*from_list_ptr) = (RF_DiskQueueData_t *) NULL;
+       (*from_list_ptr) = NULL;
 }
 
 
@@ -224,18 +222,18 @@
        DO_CHECK_STATE(hdr);
 
        if (hdr->left_cnt == 0 && hdr->right_cnt == 0)
-               return ((RF_DiskQueueData_t *) NULL);
+               return (NULL);
 
        range = RF_MIN(hdr->range_for_avg, RF_MIN(hdr->left_cnt, hdr->right_cnt));
        for (i = 0, tmp = hdr->left, sum_dist_left =
            ((hdr->direction == rf_cvscan_RIGHT) ? range * hdr->change_penalty : 0);
-           tmp != (RF_DiskQueueData_t *) NULL && i < range;
+           tmp != NULL && i < range;
            tmp = tmp->next, i++) {
                sum_dist_left += hdr->cur_block - tmp->sectorOffset;
        }
        for (i = 0, tmp = hdr->right, sum_dist_right =
            ((hdr->direction == rf_cvscan_LEFT) ? range * hdr->change_penalty : 0);
-           tmp != (RF_DiskQueueData_t *) NULL && i < range;
+           tmp != NULL && i < range;
            tmp = tmp->next, i++) {
                sum_dist_right += tmp->sectorOffset - hdr->cur_block;
        }
@@ -256,13 +254,13 @@
        ReBalance(hdr);
 
        if (hdr->left_cnt == 0 && hdr->right_cnt == 0
-           && hdr->burner != (RF_DiskQueueData_t *) NULL) {
+           && hdr->burner != NULL) {
                /*
                ** restore low priority requests for next dequeue
                */
                RF_DiskQueueData_t *burner = hdr->burner;
                hdr->nxt_priority = burner->priority;
-               while (burner != (RF_DiskQueueData_t *) NULL
+               while (burner != NULL
                    && burner->priority == hdr->nxt_priority) {
                        RF_DiskQueueData_t *next = burner->next;
                        RealEnqueue(hdr, burner);
@@ -291,13 +289,13 @@
                range = RF_MIN(hdr->range_for_avg, RF_MIN(hdr->left_cnt, hdr->right_cnt));
                for (i = 0, tmp = hdr->left, sum_dist_left =
                    ((hdr->direction == rf_cvscan_RIGHT) ? range * hdr->change_penalty : 0);
-                   tmp != (RF_DiskQueueData_t *) NULL && i < range;
+                   tmp != NULL && i < range;
                    tmp = tmp->next, i++) {
                        sum_dist_left += hdr->cur_block - tmp->sectorOffset;
                }
                for (i = 0, tmp = hdr->right, sum_dist_right =
                    ((hdr->direction == rf_cvscan_LEFT) ? range * hdr->change_penalty : 0);
-                   tmp != (RF_DiskQueueData_t *) NULL && i < range;
+                   tmp != NULL && i < range;
                    tmp = tmp->next, i++) {
                        sum_dist_right += tmp->sectorOffset - hdr->cur_block;
                }
@@ -335,8 +333,8 @@



Home | Main Index | Thread Index | Old Index