Commit 1121b219 authored by Nathan Scott's avatar Nathan Scott Committed by Tim Shimmin

[XFS] use NULL for pointer initialisation instead of zero-cast-to-ptr

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26562a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
parent 8801bb99
...@@ -670,7 +670,7 @@ xfs_alloc_insrec( ...@@ -670,7 +670,7 @@ xfs_alloc_insrec(
} }
#endif #endif
nbno = NULLAGBLOCK; nbno = NULLAGBLOCK;
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
/* /*
* If the block is full, we can't insert the new entry until we * If the block is full, we can't insert the new entry until we
* make the block un-full. * make the block un-full.
...@@ -981,7 +981,7 @@ xfs_alloc_lookup( ...@@ -981,7 +981,7 @@ xfs_alloc_lookup(
*/ */
bp = cur->bc_bufs[level]; bp = cur->bc_bufs[level];
if (bp && XFS_BUF_ADDR(bp) != d) if (bp && XFS_BUF_ADDR(bp) != d)
bp = (xfs_buf_t *)0; bp = NULL;
if (!bp) { if (!bp) {
/* /*
* Need to get a new buffer. Read it, then * Need to get a new buffer. Read it, then
...@@ -2044,7 +2044,7 @@ xfs_alloc_insert( ...@@ -2044,7 +2044,7 @@ xfs_alloc_insert(
nbno = NULLAGBLOCK; nbno = NULLAGBLOCK;
nrec.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); nrec.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock);
nrec.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); nrec.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount);
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
pcur = cur; pcur = cur;
/* /*
* Loop going up the tree, starting at the leaf level. * Loop going up the tree, starting at the leaf level.
...@@ -2076,7 +2076,7 @@ xfs_alloc_insert( ...@@ -2076,7 +2076,7 @@ xfs_alloc_insert(
*/ */
if (ncur) { if (ncur) {
pcur = ncur; pcur = ncur;
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
} }
} while (nbno != NULLAGBLOCK); } while (nbno != NULLAGBLOCK);
*stat = i; *stat = i;
......
...@@ -352,7 +352,7 @@ xfs_bmbt_delrec( ...@@ -352,7 +352,7 @@ xfs_bmbt_delrec(
XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_BMBT_TRACE_ARGI(cur, level); XFS_BMBT_TRACE_ARGI(cur, level);
ptr = cur->bc_ptrs[level]; ptr = cur->bc_ptrs[level];
tcur = (xfs_btree_cur_t *)0; tcur = NULL;
if (ptr == 0) { if (ptr == 0) {
XFS_BMBT_TRACE_CURSOR(cur, EXIT); XFS_BMBT_TRACE_CURSOR(cur, EXIT);
*stat = 0; *stat = 0;
...@@ -755,7 +755,7 @@ xfs_bmbt_insrec( ...@@ -755,7 +755,7 @@ xfs_bmbt_insrec(
ASSERT(level < cur->bc_nlevels); ASSERT(level < cur->bc_nlevels);
XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
XFS_BMBT_TRACE_ARGIFR(cur, level, *bnop, recp); XFS_BMBT_TRACE_ARGIFR(cur, level, *bnop, recp);
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(recp)); key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(recp));
optr = ptr = cur->bc_ptrs[level]; optr = ptr = cur->bc_ptrs[level];
if (ptr == 0) { if (ptr == 0) {
...@@ -1126,7 +1126,7 @@ xfs_bmbt_lookup( ...@@ -1126,7 +1126,7 @@ xfs_bmbt_lookup(
d = XFS_FSB_TO_DADDR(mp, fsbno); d = XFS_FSB_TO_DADDR(mp, fsbno);
bp = cur->bc_bufs[level]; bp = cur->bc_bufs[level];
if (bp && XFS_BUF_ADDR(bp) != d) if (bp && XFS_BUF_ADDR(bp) != d)
bp = (xfs_buf_t *)0; bp = NULL;
if (!bp) { if (!bp) {
if ((error = xfs_btree_read_bufl(mp, tp, fsbno, if ((error = xfs_btree_read_bufl(mp, tp, fsbno,
0, &bp, XFS_BMAP_BTREE_REF))) { 0, &bp, XFS_BMAP_BTREE_REF))) {
...@@ -2170,7 +2170,7 @@ xfs_bmbt_insert( ...@@ -2170,7 +2170,7 @@ xfs_bmbt_insert(
level = 0; level = 0;
nbno = NULLFSBLOCK; nbno = NULLFSBLOCK;
xfs_bmbt_disk_set_all(&nrec, &cur->bc_rec.b); xfs_bmbt_disk_set_all(&nrec, &cur->bc_rec.b);
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
pcur = cur; pcur = cur;
do { do {
if ((error = xfs_bmbt_insrec(pcur, level++, &nbno, &nrec, &ncur, if ((error = xfs_bmbt_insrec(pcur, level++, &nbno, &nrec, &ncur,
...@@ -2197,7 +2197,7 @@ xfs_bmbt_insert( ...@@ -2197,7 +2197,7 @@ xfs_bmbt_insert(
} }
if (ncur) { if (ncur) {
pcur = ncur; pcur = ncur;
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
} }
} while (nbno != NULLFSBLOCK); } while (nbno != NULLFSBLOCK);
XFS_BMBT_TRACE_CURSOR(cur, EXIT); XFS_BMBT_TRACE_CURSOR(cur, EXIT);
......
...@@ -458,7 +458,7 @@ xfs_ialloc_ag_select( ...@@ -458,7 +458,7 @@ xfs_ialloc_ag_select(
*/ */
if (XFS_FORCED_SHUTDOWN(mp)) { if (XFS_FORCED_SHUTDOWN(mp)) {
up_read(&mp->m_peraglock); up_read(&mp->m_peraglock);
return (xfs_buf_t *)0; return NULL;
} }
agno++; agno++;
if (agno >= agcount) if (agno >= agcount)
...@@ -466,7 +466,7 @@ xfs_ialloc_ag_select( ...@@ -466,7 +466,7 @@ xfs_ialloc_ag_select(
if (agno == pagno) { if (agno == pagno) {
if (flags == 0) { if (flags == 0) {
up_read(&mp->m_peraglock); up_read(&mp->m_peraglock);
return (xfs_buf_t *)0; return NULL;
} }
flags = 0; flags = 0;
} }
......
...@@ -600,7 +600,7 @@ xfs_inobt_insrec( ...@@ -600,7 +600,7 @@ xfs_inobt_insrec(
} }
#endif #endif
nbno = NULLAGBLOCK; nbno = NULLAGBLOCK;
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
/* /*
* If the block is full, we can't insert the new entry until we * If the block is full, we can't insert the new entry until we
* make the block un-full. * make the block un-full.
...@@ -878,7 +878,7 @@ xfs_inobt_lookup( ...@@ -878,7 +878,7 @@ xfs_inobt_lookup(
*/ */
bp = cur->bc_bufs[level]; bp = cur->bc_bufs[level];
if (bp && XFS_BUF_ADDR(bp) != d) if (bp && XFS_BUF_ADDR(bp) != d)
bp = (xfs_buf_t *)0; bp = NULL;
if (!bp) { if (!bp) {
/* /*
* Need to get a new buffer. Read it, then * Need to get a new buffer. Read it, then
...@@ -1933,7 +1933,7 @@ xfs_inobt_insert( ...@@ -1933,7 +1933,7 @@ xfs_inobt_insert(
nrec.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); nrec.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino);
nrec.ir_freecount = cpu_to_be32(cur->bc_rec.i.ir_freecount); nrec.ir_freecount = cpu_to_be32(cur->bc_rec.i.ir_freecount);
nrec.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); nrec.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free);
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
pcur = cur; pcur = cur;
/* /*
* Loop going up the tree, starting at the leaf level. * Loop going up the tree, starting at the leaf level.
...@@ -1965,7 +1965,7 @@ xfs_inobt_insert( ...@@ -1965,7 +1965,7 @@ xfs_inobt_insert(
*/ */
if (ncur) { if (ncur) {
pcur = ncur; pcur = ncur;
ncur = (xfs_btree_cur_t *)0; ncur = NULL;
} }
} while (nbno != NULLAGBLOCK); } while (nbno != NULLAGBLOCK);
*stat = i; *stat = i;
......
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