From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751844Ab0HAWX3 (ORCPT ); Sun, 1 Aug 2010 18:23:29 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:44336 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732Ab0HAWX2 (ORCPT ); Sun, 1 Aug 2010 18:23:28 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=FZk7Rk9DXazJSISUnXcPBpn8qc0Ws90eBrC742+8bdgdc4E07DIuluJZheClq1P9TW Z9mLciJXtTKS3ljcdtAcuFE7XvuCxYteUMCyGyju2IVakc6yveqkOguccXtNFv9Kb5fe 8Mc2Tv5/D2OsZE/KpJocRswdPF4xAs5VKYJi4= Message-ID: <4C55F3EB.6000903@gmail.com> Date: Sun, 01 Aug 2010 15:23:39 -0700 From: "Justin P. Mattock" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100615 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: 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 References: <1278984400-8837-1-git-send-email-justinmattock@gmail.com> <4C5473E0.308@gmail.com> <20100731190757.GC9734@agk-dp.fab.redhat.com> In-Reply-To: <20100731190757.GC9734@agk-dp.fab.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Justin P. Mattock --- 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