Commit 01189f38 authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

[XFS] sparse: fix uses of NULL in place of zero and vice versa.

From Chris Wedgwood.

SGI Modid: xfs-linux:xfs-kern:174819a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent c7b22357
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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.
......
......@@ -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)))
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......@@ -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 {
......
......@@ -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);
}
/*
......
......@@ -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;
......
......@@ -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 */
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment