From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/9] xfsprogs: Fix miscellaneous warnings in libxfs
Date: Sun, 17 Jan 2010 06:53:36 -0500 [thread overview]
Message-ID: <20100117115336.GE10994@infradead.org> (raw)
In-Reply-To: <1263463752-5052-3-git-send-email-david@fromorbit.com>
> -/* space allocation */
> +/* space allocation - use static inlines to avoid unused var warnings */
> #define xfs_alloc_search_busy(tp,ag,b,len) ((void) 0)
> -#define xfs_alloc_mark_busy(tp,ag,b,len) ((void) 0)
> +static inline void xfs_alloc_mark_busy(xfs_trans_t *tp,
> + xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len) {}
> #define xfs_rotorstep 1
> #define xfs_bmap_rtalloc(a) (ENOSYS)
> #define xfs_rtpick_extent(mp,tp,len,p) (ENOSYS)
Maybe just convert all these to inlines so that we make sure all
arguments are evaluated?
> diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
> index cf1123a..4cc6431 100644
> --- a/libxfs/xfs_bmap.c
> +++ b/libxfs/xfs_bmap.c
> @@ -4274,7 +4274,7 @@ xfs_bmapi(
> xfs_fsblock_t abno; /* allocated block number */
> xfs_extlen_t alen; /* allocated extent length */
> xfs_fileoff_t aoff; /* allocated file offset */
> - xfs_bmalloca_t bma; /* args for xfs_bmap_alloc */
> + xfs_bmalloca_t bma = { 0 }; /* args for xfs_bmap_alloc */
> xfs_btree_cur_t *cur; /* bmap btree cursor */
> xfs_fileoff_t end; /* end of mapped file region */
> int eof; /* we've hit the end of extents */
Not nice but okay..
> diff --git a/libxfs/xfs_mount.c b/libxfs/xfs_mount.c
> index 02bff42..662c8d2 100644
> --- a/libxfs/xfs_mount.c
> +++ b/libxfs/xfs_mount.c
> @@ -400,15 +400,14 @@ xfs_mod_sb(xfs_trans_t *tp, __int64_t fields)
>
> xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb, fields);
>
> - /* find modified range */
> + /* find modified range - get last first to avoid spurious warning */
> + f = (xfs_sb_field_t)xfs_highbit64((__uint64_t)fields);
> + ASSERT((1LL << f) & XFS_SB_MOD_BITS);
> + last = xfs_sb_info[f + 1].offset - 1;
>
> f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields);
> ASSERT((1LL << f) & XFS_SB_MOD_BITS);
> first = xfs_sb_info[f].offset;
>
> - f = (xfs_sb_field_t)xfs_highbit64((__uint64_t)fields);
> - ASSERT((1LL << f) & XFS_SB_MOD_BITS);
> - last = xfs_sb_info[f + 1].offset - 1;
> -
I don't see how this can shut up a warning, but as it doesn't cause harm
I'm fine with it. But this and the above one really need to go in via
the kernel tree first.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-17 11:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 10:09 [PATCH 0/9] xfsprogs: fix build warnings V2 Dave Chinner
2010-01-14 10:09 ` [PATCH 1/9] xfsprogs: fix sign warnings in libxfs Dave Chinner
2010-01-17 12:10 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 2/9] xfsprogs: Fix miscellaneous " Dave Chinner
2010-01-17 11:53 ` Christoph Hellwig [this message]
2010-01-14 10:09 ` [PATCH 3/9] xfsprogs: fix missing error check in xfs_rtfree_range " Dave Chinner
2010-01-17 11:52 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 4/9] xfsprogs: fix warning in adfs superblock probe Dave Chinner
2010-01-17 12:11 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 5/9] xfsprogs: fix some trivial warnings in xfs_db Dave Chinner
2010-01-17 12:12 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 6/9] xfsprogs: fix trivial warnings in xfs_fsr Dave Chinner
2010-01-17 11:51 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 7/9] xfsprogs: fix print format warnings in xfs_io Dave Chinner
2010-01-17 11:51 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 8/9] xfsprogs: fix sign warning in mkfs directory code Dave Chinner
2010-01-17 12:13 ` Christoph Hellwig
2010-01-14 10:09 ` [PATCH 9/9] xfsprogs: fix build warnings in repair Dave Chinner
2010-01-15 7:09 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100117115336.GE10994@infradead.org \
--to=hch@infradead.org \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox