]> git.hungrycats.org Git - linux/commitdiff
[XFS] sparse: fix uses of NULL in place of zero and vice versa.
authorNathan Scott <nathans@sgi.com>
Thu, 19 Aug 2004 21:09:14 +0000 (07:09 +1000)
committerNathan Scott <nathans@lips.borg.umn.edu>
Thu, 19 Aug 2004 21:09:14 +0000 (07:09 +1000)
From Chris Wedgwood.

SGI Modid: xfs-linux:xfs-kern:174819a
Signed-off-by: Nathan Scott <nathans@sgi.com>
14 files changed:
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/quota/xfs_dquot.c
fs/xfs/quota/xfs_qm_stats.c
fs/xfs/xfs_alloc.c
fs/xfs/xfs_alloc_btree.c
fs/xfs/xfs_bmap_btree.c
fs/xfs/xfs_da_btree.c
fs/xfs/xfs_dir2_trace.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_trans_item.c

index 7122efdba49160adb9e31710149a9b1374527ece..249f6401ff2283552bc10209d3f4ddd08088985d 100644 (file)
@@ -264,7 +264,7 @@ xfs_probe_unwritten_page(
 
        page = find_trylock_page(mapping, index);
        if (!page)
-               return 0;
+               return NULL;
        if (PageWriteback(page))
                goto out;
 
index 00818cd70e7ddc1489dc9be776f2947abf7c917c..b62255dc7618a6794593ad736d901755aa4973d7 100644 (file)
@@ -573,7 +573,7 @@ linvfs_get_parent(
 
        dotdot.d_name.name = "..";
        dotdot.d_name.len = 2;
-       dotdot.d_inode = 0;
+       dotdot.d_inode = NULL;
 
        cvp = NULL;
        vp = LINVFS_GET_VP(child->d_inode);
index d1368c92dc31a11647a078cb5e152c2897c395c4..9a26a60419e981a7ab97a9ad91b2b690da1fdaf7 100644 (file)
@@ -145,7 +145,7 @@ xfs_qm_dqinit(
                 dqp->q_res_icount = 0;
                 dqp->q_res_rtbcount = 0;
                 dqp->q_pincount = 0;
-                dqp->q_hash = 0;
+                dqp->q_hash = NULL;
                 ASSERT(dqp->dq_flnext == dqp->dq_flprev);
 
 #ifdef XFS_DQUOT_TRACE
index d3553ea4a74ee6d0d03705960fafeba1c4298d9b..29978e037fee490081226fd28f8d28e5c8114206 100644 (file)
@@ -137,8 +137,8 @@ xfs_qm_read_stats(
 void
 xfs_qm_init_procfs(void)
 {
-       create_proc_read_entry("fs/xfs/xqmstat", 0, 0, xfs_qm_read_stats, NULL);
-       create_proc_read_entry("fs/xfs/xqm", 0, 0, xfs_qm_read_xfsquota, NULL);
+       create_proc_read_entry("fs/xfs/xqmstat", 0, NULL, xfs_qm_read_stats, NULL);
+       create_proc_read_entry("fs/xfs/xqm", 0, NULL, xfs_qm_read_xfsquota, NULL);
 }
 
 void
index 74cad985b0032fac41ae4937bf7f6c1e15271bf8..02337c2a4caad00985cb2d1dde9950acf267b992 100644 (file)
@@ -665,7 +665,7 @@ xfs_alloc_ag_vextent_exact(
         * Allocate/initialize a cursor for the by-number freespace btree.
         */
        bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_BNO, 0, 0);
+               args->agno, XFS_BTNUM_BNO, NULL, 0);
        /*
         * Lookup bno and minlen in the btree (minlen is irrelevant, really).
         * Look for the closest free block <= bno, it must contain bno
@@ -721,7 +721,7 @@ xfs_alloc_ag_vextent_exact(
         * Allocate/initialize a cursor for the by-size btree.
         */
        cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_CNT, 0, 0);
+               args->agno, XFS_BTNUM_CNT, NULL, 0);
        ASSERT(args->agbno + args->len <=
                INT_GET(XFS_BUF_TO_AGF(args->agbp)->agf_length,
                        ARCH_CONVERT));
@@ -788,7 +788,7 @@ xfs_alloc_ag_vextent_near(
         * Get a cursor for the by-size btree.
         */
        cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_CNT, 0, 0);
+               args->agno, XFS_BTNUM_CNT, NULL, 0);
        ltlen = 0;
        bno_cur_lt = bno_cur_gt = NULL;
        /*
@@ -916,7 +916,7 @@ xfs_alloc_ag_vextent_near(
                 * Set up a cursor for the by-bno tree.
                 */
                bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp,
-                       args->agbp, args->agno, XFS_BTNUM_BNO, 0, 0);
+                       args->agbp, args->agno, XFS_BTNUM_BNO, NULL, 0);
                /*
                 * Fix up the btree entries.
                 */
@@ -944,7 +944,7 @@ xfs_alloc_ag_vextent_near(
         * Allocate and initialize the cursor for the leftward search.
         */
        bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_BNO, 0, 0);
+               args->agno, XFS_BTNUM_BNO, NULL, 0);
        /*
         * Lookup <= bno to find the leftward search's starting point.
         */
@@ -956,7 +956,7 @@ xfs_alloc_ag_vextent_near(
                 * search.
                 */
                bno_cur_gt = bno_cur_lt;
-               bno_cur_lt = 0;
+               bno_cur_lt = NULL;
        }
        /*
         * Found something.  Duplicate the cursor for the rightward search.
@@ -1301,7 +1301,7 @@ xfs_alloc_ag_vextent_size(
         * Allocate and initialize a cursor for the by-size btree.
         */
        cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_CNT, 0, 0);
+               args->agno, XFS_BTNUM_CNT, NULL, 0);
        bno_cur = NULL;
        /*
         * Look for an entry >= maxlen+alignment-1 blocks.
@@ -1406,7 +1406,7 @@ xfs_alloc_ag_vextent_size(
         * Allocate and initialize a cursor for the by-block tree.
         */
        bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp,
-               args->agno, XFS_BTNUM_BNO, 0, 0);
+               args->agno, XFS_BTNUM_BNO, NULL, 0);
        if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen,
                        rbno, rlen, XFSA_FIXUP_CNT_OK)))
                goto error0;
@@ -1553,7 +1553,7 @@ xfs_free_ag_extent(
        /*
         * Allocate and initialize a cursor for the by-block btree.
         */
-       bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, 0,
+       bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, NULL,
                0);
        cnt_cur = NULL;
        /*
@@ -1613,7 +1613,7 @@ xfs_free_ag_extent(
        /*
         * Now allocate and initialize a cursor for the by-size tree.
         */
-       cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, 0,
+       cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, NULL,
                0);
        /*
         * Have both left and right contiguous neighbors.
index 55c405cc560977283d3d81cbda1365c137c61fc6..6b5de3a284e3f00ea0323cb38fc1b84a03ab1f1f 100644 (file)
@@ -263,7 +263,7 @@ xfs_alloc_delrec(
                        /*
                         * Update the cursor so there's one fewer level.
                         */
-                       xfs_btree_setbuf(cur, level, 0);
+                       xfs_btree_setbuf(cur, level, NULL);
                        cur->bc_nlevels--;
                } else if (level > 0 &&
                           (error = xfs_alloc_decrement(cur, level, &i)))
index ed83f855df3455217ce91ed6834f26af01b7ead6..0ed189102257d0521d665d78cc7cddd425d7936a 100644 (file)
@@ -1953,7 +1953,7 @@ xfs_bmbt_get_block(
                *bpp = cur->bc_bufs[level];
                rval = XFS_BUF_TO_BMBT_BLOCK(*bpp);
        } else {
-               *bpp = 0;
+               *bpp = NULL;
                ifp = XFS_IFORK_PTR(cur->bc_private.b.ip,
                        cur->bc_private.b.whichfork);
                rval = ifp->if_broot;
index f0431b7e625316cc4b9c87c48dfe017135359c1d..bbe00dc550d656818ee28ca80058bab77bc2fc1d 100644 (file)
@@ -2092,7 +2092,7 @@ xfs_da_do_buf(
        int             caller,
        inst_t          *ra)
 {
-       xfs_buf_t       *bp = 0;
+       xfs_buf_t       *bp = NULL;
        xfs_buf_t       **bplist;
        int             error=0;
        int             i;
index c6747162f251839c61e09e9d2605bb15c83acec2..9d64173931408d166a90f247ee3bb7f6d3721957 100644 (file)
@@ -211,7 +211,7 @@ xfs_dir2_trace_args_s(
                (void *)((unsigned long)(args->inumber >> 32)),
                (void *)((unsigned long)(args->inumber & 0xFFFFFFFF)),
                (void *)args->dp, (void *)args->trans,
-               (void *)(unsigned long)args->justcheck, (void *)(long)s, 0);
+               (void *)(unsigned long)args->justcheck, (void *)(long)s, NULL);
 }
 
 void
index 934705ec4054aaeca5b8bc8177b129909368f839..da75ee97371162821f1f37314bc6aa6aecceeb5c 100644 (file)
@@ -3749,6 +3749,6 @@ xfs_ilock_trace(xfs_inode_t *ip, int lock, unsigned int lockflags, inst_t *ra)
                     (void *)ra,                /* caller of ilock */
                     (void *)(unsigned long)current_cpu(),
                     (void *)(unsigned long)current_pid(),
-                    0,0,0,0,0,0,0,0,0,0);
+                    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 }
 #endif
index 212d4e837a3a5705ea35fba04493e39e4f491d29..1c057d594679ff8e45fc65ce0e5d37301305e980 100644 (file)
@@ -356,13 +356,13 @@ xfs_log_notify(xfs_mount_t          *mp,          /* mount of partition */
        if (!xlog_debug && xlog_target == log->l_targ)
                return 0;
 #endif
-       cb->cb_next = 0;
+       cb->cb_next = NULL;
        spl = LOG_LOCK(log);
        abortflg = (iclog->ic_state & XLOG_STATE_IOERROR);
        if (!abortflg) {
                ASSERT_ALWAYS((iclog->ic_state == XLOG_STATE_ACTIVE) ||
                              (iclog->ic_state == XLOG_STATE_WANT_SYNC));
-               cb->cb_next = 0;
+               cb->cb_next = NULL;
                *(iclog->ic_callback_tail) = cb;
                iclog->ic_callback_tail = &(cb->cb_next);
        }
@@ -564,7 +564,7 @@ xfs_log_unmount_write(xfs_mount_t *mp)
        xlog_in_core_t   *first_iclog;
 #endif
        xfs_log_iovec_t  reg[1];
-       xfs_log_ticket_t tic = 0;
+       xfs_log_ticket_t tic = NULL;
        xfs_lsn_t        lsn;
        int              error;
        SPLDECL(s);
@@ -1277,7 +1277,7 @@ xlog_commit_record(xfs_mount_t  *mp,
        int             error;
        xfs_log_iovec_t reg[1];
 
-       reg[0].i_addr = 0;
+       reg[0].i_addr = NULL;
        reg[0].i_len = 0;
 
        ASSERT_ALWAYS(iclog);
@@ -1857,7 +1857,7 @@ xlog_state_clean_log(xlog_t *log)
                if (iclog->ic_state == XLOG_STATE_DIRTY) {
                        iclog->ic_state = XLOG_STATE_ACTIVE;
                        iclog->ic_offset       = 0;
-                       iclog->ic_callback      = 0;   /* don't need to free */
+                       iclog->ic_callback      = NULL;   /* don't need to free */
                        /*
                         * If the number of ops in this iclog indicate it just
                         * contains the dummy transaction, we can
@@ -2080,7 +2080,7 @@ xlog_state_do_callback(
 
                        while (cb != 0) {
                                iclog->ic_callback_tail = &(iclog->ic_callback);
-                               iclog->ic_callback = 0;
+                               iclog->ic_callback = NULL;
                                LOG_UNLOCK(log, s);
 
                                /* perform callbacks in the order given */
@@ -3098,7 +3098,7 @@ xlog_state_ticket_alloc(xlog_t *log)
                log->l_ticket_cnt++;
                log->l_ticket_tcnt++;
        }
-       t_list->t_next = 0;
+       t_list->t_next = NULL;
        log->l_tail = t_list;
        LOG_UNLOCK(log, s);
 }      /* xlog_state_ticket_alloc */
@@ -3126,7 +3126,7 @@ xlog_ticket_put(xlog_t            *log,
        /* no need to clear fields */
 #else
        /* When we debug, it is easier if tickets are cycled */
-       ticket->t_next     = 0;
+       ticket->t_next     = NULL;
        if (log->l_tail != 0) {
                log->l_tail->t_next = ticket;
        } else {
index 2e5ab6af878ea435979da15ec823fccad7df149b..65dbbb638ec17d4f48466e7133be096ff55098cd 100644 (file)
@@ -2319,7 +2319,7 @@ xlog_recover_do_inode_trans(
                 * invalidate the buffer when we write it out below.
                 */
                imap.im_blkno = 0;
-               xfs_imap(log->l_mp, 0, ino, &imap, 0);
+               xfs_imap(log->l_mp, NULL, ino, &imap, 0);
        }
 
        /*
index 55cf2b762ba5e2fa8681f9f35b461ecb9ef43728..d2a73e9b00c4ddea23dd183c340e7a092e434792 100644 (file)
@@ -633,7 +633,7 @@ xfs_mountfs(
        xfs_buf_t       *bp;
        xfs_sb_t        *sbp = &(mp->m_sb);
        xfs_inode_t     *rip;
-       vnode_t         *rvp = 0;
+       vnode_t         *rvp = NULL;
        int             readio_log, writeio_log;
        xfs_daddr_t     d;
        __uint64_t      ret64;
index 767af4810775dfb0367866ed295e5c786cd9c4ea..1b8a756d80ed009d93a8fab688eb67c1e2b6a010 100644 (file)
@@ -290,7 +290,7 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp)
        }
        ASSERT(0);
        /* NOTREACHED */
-       return 0; /* keep gcc quite */
+       return NULL; /* keep gcc quite */
 }
 
 /*