From: Mike Snitzer <snitzer@redhat.com>
To: "Justin P. Mattock" <justinmattock@gmail.com>,
device-mapper development <dm-devel@redhat.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH]md:dm.c Fix warning: statement with no effect
Date: Tue, 11 Jan 2011 16:22:32 -0500 [thread overview]
Message-ID: <20110111212232.GA27125@redhat.com> (raw)
In-Reply-To: <4C55F3EB.6000903@gmail.com>
On Sun, Aug 01 2010 at 6:23pm -0400,
Justin P. Mattock <justinmattock@gmail.com> wrote:
> On 07/31/2010 12:07 PM, Alasdair G Kergon wrote:
> >On Sat, Jul 31, 2010 at 12:05:04PM -0700, Justin P. Mattock wrote:
> >>haven't heard any feedback on this any ideas?
> >>>Ive noticed that having CONFIG_BLK_DEV_INTEGRITY=n I get warning messages generated by GCC(below)
> >>> CC drivers/md/dm.o
> >>>drivers/md/dm.c: In function 'split_bvec':
> >>>drivers/md/dm.c:1117:3: warning: statement with no effect
> >>>drivers/md/dm.c: In function 'clone_bio':
> >>>drivers/md/dm.c:1145:3: warning: statement with no effect
> >
> >I'd suggest hiding it inside the .h files and not trying to scatter #ifdefs
> >throughout the code.
> >
> >Alasdair
> >
> >
>
>
> o.k. this ones a bit tricky.. but I did finally get this to build clean.
> below is an updated patch that gets me to build clean. Let me know
> if something other than this should be used.(or if this is a good
> solution then let me know and I'll resend)
>
> <---cut--->
>
> When building the kernel with CONFIG_BLK_DEV_INTEGRITY=n everything
> gets sent(if Im reading this correctly) too:
> (line #660 bio.h)
> #else /* CONFIG_BLK_DEV_INTEGRITY */
>
> #define bio_integrity(a) (0)
> #define bioset_integrity_create(a, b) (0)
> #define bio_integrity_prep(a) (0)
> #define bio_integrity_enabled(a) (0)
> #define bio_integrity_clone(a, b, c, d) (0)
> #define bioset_integrity_free(a) do { } while (0)
> #define bio_integrity_free(a, b) do { } while (0)
> #define bio_integrity_endio(a, b) do { } while (0)
> #define bio_integrity_advance(a, b) do { } while (0)
> #define bio_integrity_trim(a, b, c) do { } while (0)
> #define bio_integrity_split(a, b, c) do { } while (0)
> #define bio_integrity_set_tag(a, b, c) do { } while (0)
> #define bio_integrity_get_tag(a, b, c) do { } while (0)
> #define bio_integrity_init(a) do { } while (0)
>
> changing #else preprocessor to #elif !defined(CONFIG_BLK_DEV_INTEGRITY)
> opposite of #if defined(CONFIG_BLK_DEV_INTEGRITY)
> gets me to build dm.c without the warning message.
> please have a look when you have time and let me know if this is a good
> solution to this.
I'm not seeing any warnings. My .config has:
# CONFIG_BLK_DEV_INTEGRITY is not set
The bio.h block is:
#if defined(CONFIG_BLK_DEV_INTEGRITY)
...
#else /* CONFIG_BLK_DEV_INTEGRITY */
#define bio_integrity_clone(a, b, c, d) (0)
#endif
So I'm not seeing why your proposed change matters. Should already
behave properly (and in practice I'm not seeing any problems).
> Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
>
> ---
> include/linux/bio.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index 7fc5606..a8259c8 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -657,7 +657,7 @@ extern int bioset_integrity_create(struct
> bio_set *, int);
> extern void bioset_integrity_free(struct bio_set *);
> extern void bio_integrity_init(void);
>
> -#else /* CONFIG_BLK_DEV_INTEGRITY */
> +#elif !defined(CONFIG_BLK_DEV_INTEGRITY) /* CONFIG_BLK_DEV_INTEGRITY */
>
> #define bio_integrity(a) (0)
> #define bioset_integrity_create(a, b) (0)
> -- 1.7.1.rc1.21.gf3bd6
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2011-01-11 21:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 1:26 [PATCH]md:dm.c Fix warning: statement with no effect Justin P. Mattock
2010-07-31 19:05 ` Justin P. Mattock
2010-07-31 19:07 ` Alasdair G Kergon
2010-07-31 19:13 ` Justin P. Mattock
2010-08-01 22:23 ` Justin P. Mattock
2011-01-11 21:22 ` Mike Snitzer [this message]
2011-01-12 1:26 ` Justin Mattock
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=20110111212232.GA27125@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=justinmattock@gmail.com \
--cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).