Commit 4b80916b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Tim Shimmin

[XFS] Fix sparse NULL vs 0 warnings

Sparse now warns about comparing pointers to 0, so change all instance
where that happens to NULL instead.

SGI-PV: 968555
SGI-Modid: xfs-linux-melb:xfs-kern:29308a
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 8da22d7a
...@@ -2185,13 +2185,13 @@ xlog_state_do_callback( ...@@ -2185,13 +2185,13 @@ xlog_state_do_callback(
} }
cb = iclog->ic_callback; cb = iclog->ic_callback;
while (cb != 0) { while (cb) {
iclog->ic_callback_tail = &(iclog->ic_callback); iclog->ic_callback_tail = &(iclog->ic_callback);
iclog->ic_callback = NULL; iclog->ic_callback = NULL;
LOG_UNLOCK(log, s); LOG_UNLOCK(log, s);
/* perform callbacks in the order given */ /* perform callbacks in the order given */
for (; cb != 0; cb = cb_next) { for (; cb; cb = cb_next) {
cb_next = cb->cb_next; cb_next = cb->cb_next;
cb->cb_func(cb->cb_arg, aborted); cb->cb_func(cb->cb_arg, aborted);
} }
...@@ -2202,7 +2202,7 @@ xlog_state_do_callback( ...@@ -2202,7 +2202,7 @@ xlog_state_do_callback(
loopdidcallbacks++; loopdidcallbacks++;
funcdidcallbacks++; funcdidcallbacks++;
ASSERT(iclog->ic_callback == 0); ASSERT(iclog->ic_callback == NULL);
if (!(iclog->ic_state & XLOG_STATE_IOERROR)) if (!(iclog->ic_state & XLOG_STATE_IOERROR))
iclog->ic_state = XLOG_STATE_DIRTY; iclog->ic_state = XLOG_STATE_DIRTY;
...@@ -3242,10 +3242,10 @@ xlog_ticket_put(xlog_t *log, ...@@ -3242,10 +3242,10 @@ xlog_ticket_put(xlog_t *log,
#else #else
/* When we debug, it is easier if tickets are cycled */ /* When we debug, it is easier if tickets are cycled */
ticket->t_next = NULL; ticket->t_next = NULL;
if (log->l_tail != 0) { if (log->l_tail) {
log->l_tail->t_next = ticket; log->l_tail->t_next = ticket;
} else { } else {
ASSERT(log->l_freelist == 0); ASSERT(log->l_freelist == NULL);
log->l_freelist = ticket; log->l_freelist = ticket;
} }
log->l_tail = ticket; log->l_tail = ticket;
...@@ -3463,7 +3463,7 @@ xlog_verify_iclog(xlog_t *log, ...@@ -3463,7 +3463,7 @@ xlog_verify_iclog(xlog_t *log,
s = LOG_LOCK(log); s = LOG_LOCK(log);
icptr = log->l_iclog; icptr = log->l_iclog;
for (i=0; i < log->l_iclog_bufs; i++) { for (i=0; i < log->l_iclog_bufs; i++) {
if (icptr == 0) if (icptr == NULL)
xlog_panic("xlog_verify_iclog: invalid ptr"); xlog_panic("xlog_verify_iclog: invalid ptr");
icptr = icptr->ic_next; icptr = icptr->ic_next;
} }
......
...@@ -1366,7 +1366,7 @@ xlog_recover_add_to_cont_trans( ...@@ -1366,7 +1366,7 @@ xlog_recover_add_to_cont_trans(
int old_len; int old_len;
item = trans->r_itemq; item = trans->r_itemq;
if (item == 0) { if (item == NULL) {
/* finish copying rest of trans header */ /* finish copying rest of trans header */
xlog_recover_add_item(&trans->r_itemq); xlog_recover_add_item(&trans->r_itemq);
ptr = (xfs_caddr_t) &trans->r_theader + ptr = (xfs_caddr_t) &trans->r_theader +
...@@ -1412,7 +1412,7 @@ xlog_recover_add_to_trans( ...@@ -1412,7 +1412,7 @@ xlog_recover_add_to_trans(
if (!len) if (!len)
return 0; return 0;
item = trans->r_itemq; item = trans->r_itemq;
if (item == 0) { if (item == NULL) {
ASSERT(*(uint *)dp == XFS_TRANS_HEADER_MAGIC); ASSERT(*(uint *)dp == XFS_TRANS_HEADER_MAGIC);
if (len == sizeof(xfs_trans_header_t)) if (len == sizeof(xfs_trans_header_t))
xlog_recover_add_item(&trans->r_itemq); xlog_recover_add_item(&trans->r_itemq);
...@@ -1467,12 +1467,12 @@ xlog_recover_unlink_tid( ...@@ -1467,12 +1467,12 @@ xlog_recover_unlink_tid(
xlog_recover_t *tp; xlog_recover_t *tp;
int found = 0; int found = 0;
ASSERT(trans != 0); ASSERT(trans != NULL);
if (trans == *q) { if (trans == *q) {
*q = (*q)->r_next; *q = (*q)->r_next;
} else { } else {
tp = *q; tp = *q;
while (tp != 0) { while (tp) {
if (tp->r_next == trans) { if (tp->r_next == trans) {
found = 1; found = 1;
break; break;
...@@ -1495,7 +1495,7 @@ xlog_recover_insert_item_backq( ...@@ -1495,7 +1495,7 @@ xlog_recover_insert_item_backq(
xlog_recover_item_t **q, xlog_recover_item_t **q,
xlog_recover_item_t *item) xlog_recover_item_t *item)
{ {
if (*q == 0) { if (*q == NULL) {
item->ri_prev = item->ri_next = item; item->ri_prev = item->ri_next = item;
*q = item; *q = item;
} else { } else {
...@@ -1899,7 +1899,7 @@ xlog_recover_do_reg_buffer( ...@@ -1899,7 +1899,7 @@ xlog_recover_do_reg_buffer(
break; break;
nbits = xfs_contig_bits(data_map, map_size, bit); nbits = xfs_contig_bits(data_map, map_size, bit);
ASSERT(nbits > 0); ASSERT(nbits > 0);
ASSERT(item->ri_buf[i].i_addr != 0); ASSERT(item->ri_buf[i].i_addr != NULL);
ASSERT(item->ri_buf[i].i_len % XFS_BLI_CHUNK == 0); ASSERT(item->ri_buf[i].i_len % XFS_BLI_CHUNK == 0);
ASSERT(XFS_BUF_COUNT(bp) >= ASSERT(XFS_BUF_COUNT(bp) >=
((uint)bit << XFS_BLI_SHIFT)+(nbits<<XFS_BLI_SHIFT)); ((uint)bit << XFS_BLI_SHIFT)+(nbits<<XFS_BLI_SHIFT));
......
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