Use NULL as appropriate.
Fixes sparse warnings about this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
};
const field_t dir2_inou_flds[] = {
- { "i8", FLDT_DIR2_INO8, 0, dir2_inou_i8_count, FLD_COUNT, TYP_INODE },
- { "i4", FLDT_DIR2_INO4, 0, dir2_inou_i4_count, FLD_COUNT, TYP_INODE },
+ { "i8", FLDT_DIR2_INO8, NULL, dir2_inou_i8_count, FLD_COUNT, TYP_INODE},
+ { "i4", FLDT_DIR2_INO4, NULL, dir2_inou_i4_count, FLD_COUNT, TYP_INODE},
{ NULL }
};
if (vflag)
setbuf(stdout, NULL);
- starttime = time(0);
+ starttime = time(NULL);
/* Save the caller's real uid */
RealUid = getuid();
signal(SIGTERM, aborter);
/* reorg for 'howlong' -- checked in 'fsrfs' */
- while (endtime > time(0)) {
+ while (endtime > time(NULL)) {
pid_t pid;
if (npasses > 1 && !fs->npass)
break;
}
}
- fsrall_cleanup(endtime <= time(0));
+ fsrall_cleanup(endtime <= time(NULL));
}
/*
if (timeout) {
fsrprintf(_("%s startpass %d, endpass %d, time %d seconds\n"),
progname, startpass, fs->npass,
- time(0) - endtime + howlong);
+ time(NULL) - endtime + howlong);
/* record where we left off */
fd = open(leftofffile, O_WRONLY|O_CREAT|O_EXCL, 0644);
break;
}
}
- if (endtime && endtime < time(0)) {
+ if (endtime && endtime < time(NULL)) {
tmp_close(mntdir);
close(fsfd);
fsrall_cleanup(1);
#define XBRW_READ LIBXFS_BREAD
#define XBRW_WRITE LIBXFS_BWRITE
#define xfs_buf_iomove(bp,off,len,data,f) libxfs_iomove(bp,off,len,data,f)
-#define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
+#define xfs_buf_zero(bp,off,len) libxfs_iomove(bp,off,len,NULL,LIBXFS_BZERO)
/* mount stuff */
#define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES
libxfs_getbuf_flags(struct xfs_buftarg *btp, xfs_daddr_t blkno, int len,
unsigned int flags)
{
- struct xfs_bufkey key = {0};
+ struct xfs_bufkey key = {NULL};
key.buftarg = btp;
key.blkno = blkno;
__libxfs_getbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map,
int nmaps, int flags)
{
- struct xfs_bufkey key = {0};
+ struct xfs_bufkey key = {NULL};
int i;
if (nmaps == 1)
void
libxfs_purgebuf(xfs_buf_t *bp)
{
- struct xfs_bufkey key = {0};
+ struct xfs_bufkey key = {NULL};
key.buftarg = bp->b_target;
key.blkno = bp->b_bn;
exit(1);
}
d = XFS_FSB_TO_DADDR(mp, map.br_startblock);
- bp = libxfs_trans_get_buf(logit ? tp : 0, mp->m_dev, d,
+ bp = libxfs_trans_get_buf(logit ? tp : NULL, mp->m_dev, d,
nb << mp->m_blkbb_log, 0);
memmove(bp->b_addr, buf, len);
if (len < bp->b_bcount)
exit(1);
}
} else
- buf = 0;
+ buf = NULL;
close(fd);
return buf;
}
uint64_t last_ino,
uint64_t *count)
{
- struct xfs_fsop_bulkreq igrpreq = {0};
+ struct xfs_fsop_bulkreq igrpreq = {NULL};
struct xfs_inogrp inogrp;
__u64 igrp_ino;
uint64_t nr = 0;
struct xfs_inogrp *inogrp,
struct xfs_bstat *bstat)
{
- struct xfs_fsop_bulkreq onereq = {0};
+ struct xfs_fsop_bulkreq onereq = {NULL};
struct xfs_bstat *bs;
__u64 oneino;
__s32 onelen = 0;
xfs_inode_iter_fn fn,
void *arg)
{
- struct xfs_fsop_bulkreq igrpreq = {0};
- struct xfs_fsop_bulkreq bulkreq = {0};
+ struct xfs_fsop_bulkreq igrpreq = {NULL};
+ struct xfs_fsop_bulkreq bulkreq = {NULL};
struct xfs_handle handle;
struct xfs_inogrp inogrp;
struct xfs_bstat bstat[XFS_INODES_PER_CHUNK];