All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Justin P. Mattock" <justinmattock@gmail.com>
To: "Justin P. Mattock" <justinmattock@gmail.com>
Cc: dm-devel@redhat.com, neilb@suse.de, agk@redhat.com,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]md:dm.c Fix warning: statement with no effect
Date: Sat, 31 Jul 2010 12:05:04 -0700	[thread overview]
Message-ID: <4C5473E0.308@gmail.com> (raw)
In-Reply-To: <1278984400-8837-1-git-send-email-justinmattock@gmail.com>

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
>
> adding in some #ifdef's fixes this warning if someone chooses not to have
> CONFIG_BLK_DEV_INTEGRITY turned on. but keep in mind not sure if this is the best approach
> i.e. should something be done in bio.h?
> Also this patch fixes a comment which was hard to read at first. Anyways have a look
> when you have time, and let me know.
>
> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>
> ---
>   drivers/md/dm.c |    6 +++++-
>   1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index d21e128..7c1cb04 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -1091,7 +1091,7 @@ static void dm_bio_destructor(struct bio *bio)
>   }
>
>   /*
> - * Creates a little bio that is just does part of a bvec.
> + * Create a little bio that just does part of a bvec.
>    */
>   static struct bio *split_bvec(struct bio *bio, sector_t sector,
>   			      unsigned short idx, unsigned int offset,
> @@ -1114,7 +1114,9 @@ static struct bio *split_bvec(struct bio *bio, sector_t sector,
>   	clone->bi_flags |= 1<<  BIO_CLONED;
>
>   	if (bio_integrity(bio)) {
> +#ifdef CONFIG_BLK_DEV_INTEGRITY
>   		bio_integrity_clone(clone, bio, GFP_NOIO, bs);
> +#endif
>   		bio_integrity_trim(clone,
>   				   bio_sector_offset(bio, idx, offset), len);
>   	}
> @@ -1142,7 +1144,9 @@ static struct bio *clone_bio(struct bio *bio, sector_t sector,
>   	clone->bi_flags&= ~(1<<  BIO_SEG_VALID);
>
>   	if (bio_integrity(bio)) {
> +#ifdef CONFIG_BLK_DEV_INTEGRITY
>   		bio_integrity_clone(clone, bio, GFP_NOIO, bs);
> +#endif
>
>   		if (idx != bio->bi_idx || clone->bi_size<  bio->bi_size)
>   			bio_integrity_trim(clone,

  reply	other threads:[~2010-07-31 19:05 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 [this message]
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
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=4C5473E0.308@gmail.com \
    --to=justinmattock@gmail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.