All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Pratyush Anand <panand@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	IDE-ML <linux-ide@vger.kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 07/14] proc/kcore: hide a harmless warning
Date: Tue, 18 Jul 2017 21:53:40 +0200	[thread overview]
Message-ID: <CAK8P3a3qrkZLkL=PuUHkaq9p021-Y+odTj5UrdM=dZw8L=oM8g@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu9+0H9w8z8_Zedd-RxXt89Y7sJ=57_ZTThfDpFe4H0uXg@mail.gmail.com>

On Fri, Jul 14, 2017 at 2:28 PM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> On 14 July 2017 at 10:25, Arnd Bergmann <arnd@arndb.de> wrote:
>> gcc warns when MODULES_VADDR/END is defined to the same value as
>> VMALLOC_START/VMALLOC_END, e.g. on x86-32:
>>
>> fs/proc/kcore.c: In function ‘add_modules_range’:
>> fs/proc/kcore.c:622:161: error: self-comparison always evaluates to false [-Werror=tautological-compare]
>>   if (/*MODULES_VADDR != VMALLOC_START && */MODULES_END != VMALLOC_END) {
>>
>
> Does it occur for subtraction as well? Or only for comparison?

This replacement patch would also address the warning:

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 45629f4b5402..35824e986c2c 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -623,7 +623,7 @@ static void __init proc_kcore_text_init(void)
 struct kcore_list kcore_modules;
 static void __init add_modules_range(void)
 {
-       if (MODULES_VADDR != VMALLOC_START && MODULES_END != VMALLOC_END) {
+       if (MODULES_VADDR - VMALLOC_START && MODULES_END - VMALLOC_END) {
                kclist_add(&kcore_modules, (void *)MODULES_VADDR,
                        MODULES_END - MODULES_VADDR, KCORE_VMALLOC);
        }

I have also verified that four of the 14 patches are not needed when building
without ccache, this is one of them:

 acpi: thermal: fix gcc-6/ccache warning
 proc/kcore: hide a harmless warning
 SFI: fix tautological-compare warning
 [media] fix warning on v4l2_subdev_call() result interpreted as bool

Not sure what to do with those, we could either ignore them all and
not care about ccache, or we try to address them all in some way.

        Arnd
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Guenter Roeck <linux@roeck-us.net>,
	IDE-ML <linux-ide@vger.kernel.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Kees Cook <keescook@chromium.org>, Ingo Molnar <mingo@kernel.org>,
	Laura Abbott <labbott@redhat.com>,
	Pratyush Anand <panand@redhat.com>
Subject: Re: [PATCH 07/14] proc/kcore: hide a harmless warning
Date: Tue, 18 Jul 2017 21:53:40 +0200	[thread overview]
Message-ID: <CAK8P3a3qrkZLkL=PuUHkaq9p021-Y+odTj5UrdM=dZw8L=oM8g@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu9+0H9w8z8_Zedd-RxXt89Y7sJ=57_ZTThfDpFe4H0uXg@mail.gmail.com>

On Fri, Jul 14, 2017 at 2:28 PM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> On 14 July 2017 at 10:25, Arnd Bergmann <arnd@arndb.de> wrote:
>> gcc warns when MODULES_VADDR/END is defined to the same value as
>> VMALLOC_START/VMALLOC_END, e.g. on x86-32:
>>
>> fs/proc/kcore.c: In function ‘add_modules_range’:
>> fs/proc/kcore.c:622:161: error: self-comparison always evaluates to false [-Werror=tautological-compare]
>>   if (/*MODULES_VADDR != VMALLOC_START && */MODULES_END != VMALLOC_END) {
>>
>
> Does it occur for subtraction as well? Or only for comparison?

This replacement patch would also address the warning:

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 45629f4b5402..35824e986c2c 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -623,7 +623,7 @@ static void __init proc_kcore_text_init(void)
 struct kcore_list kcore_modules;
 static void __init add_modules_range(void)
 {
-       if (MODULES_VADDR != VMALLOC_START && MODULES_END != VMALLOC_END) {
+       if (MODULES_VADDR - VMALLOC_START && MODULES_END - VMALLOC_END) {
                kclist_add(&kcore_modules, (void *)MODULES_VADDR,
                        MODULES_END - MODULES_VADDR, KCORE_VMALLOC);
        }

I have also verified that four of the 14 patches are not needed when building
without ccache, this is one of them:

 acpi: thermal: fix gcc-6/ccache warning
 proc/kcore: hide a harmless warning
 SFI: fix tautological-compare warning
 [media] fix warning on v4l2_subdev_call() result interpreted as bool

Not sure what to do with those, we could either ignore them all and
not care about ccache, or we try to address them all in some way.

        Arnd

  reply	other threads:[~2017-07-18 19:53 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14  9:25 [PATCH 00/14] gcc-7 warnings Arnd Bergmann
2017-07-14  9:25 ` Arnd Bergmann
2017-07-14  9:25 ` [PATCH, RESEND 01/14] ide: avoid warning for timings calculation Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14  9:25 ` [PATCH, RESEND 02/14] ata: avoid gcc-7 warning in ata_timing_quantize Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-15 10:56   ` Tejun Heo
2017-07-15 10:56     ` Tejun Heo
2017-07-14  9:25 ` [PATCH, RESEND 03/14] drm/vmwgfx: avoid gcc-7 parentheses warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14 10:11   ` Jani Nikula
2017-07-14 10:11     ` Jani Nikula
2017-07-14 19:21   ` Linus Torvalds
2017-07-14 19:21     ` Linus Torvalds
2017-07-14 19:23     ` Linus Torvalds
2017-07-14 20:28       ` Arnd Bergmann
2017-07-17 13:15         ` Sinclair Yeh
2017-07-17 13:15           ` Sinclair Yeh
2017-07-14  9:25 ` [PATCH 04/14] x86: math-emu: avoid -Wint-in-bool-context warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14  9:25 ` [PATCH 05/14] isdn: isdnloop: suppress a gcc-7 warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14 10:08   ` Joe Perches
2017-07-14 10:37     ` Arnd Bergmann
2017-07-15  4:20       ` Kevin Easton
2017-07-14  9:25 ` [PATCH 06/14] acpi: thermal: fix gcc-6/ccache warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14  9:25 ` [PATCH 07/14] proc/kcore: hide a harmless warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14 12:28   ` Ard Biesheuvel
2017-07-18 19:53     ` Arnd Bergmann [this message]
2017-07-18 19:53       ` Arnd Bergmann
2017-07-18 19:55       ` Ard Biesheuvel
2017-07-18 20:01         ` Arnd Bergmann
2017-07-18 20:07           ` Ard Biesheuvel
2017-07-18 20:21             ` Arnd Bergmann
2017-07-14  9:25 ` [PATCH 08/14] Input: adxl34x - fix gcc-7 -Wint-in-bool-context warning Arnd Bergmann
2017-07-14  9:25   ` Arnd Bergmann
2017-07-14 19:24   ` Linus Torvalds
2017-07-14 20:17     ` Arnd Bergmann
2017-07-14 21:40       ` Dmitry Torokhov
2017-07-14  9:30 ` [PATCH 09/14] SFI: fix tautological-compare warning Arnd Bergmann
2017-07-14  9:30   ` Arnd Bergmann
2017-07-14  9:31 ` [PATCH 10/14] staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read Arnd Bergmann
2017-07-14  9:31   ` Arnd Bergmann
2017-07-15 11:42   ` Jonathan Cameron
2017-07-14  9:31 ` [PATCH 11/14] IB/uverbs: fix gcc-7 type warning Arnd Bergmann
2017-07-14  9:31   ` Arnd Bergmann
2017-07-14  9:46   ` Leon Romanovsky
2017-07-14  9:31 ` [PATCH 12/14] drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning Arnd Bergmann
2017-07-14  9:31   ` Arnd Bergmann
2017-07-14  9:31 ` [PATCH 13/14] iopoll: avoid " Arnd Bergmann
2017-07-14  9:31   ` Arnd Bergmann
2017-07-14  9:55   ` Joe Perches
2017-07-14 10:22     ` Arnd Bergmann
2017-07-14  9:36 ` [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool Arnd Bergmann
2017-07-14  9:36   ` Arnd Bergmann
2017-07-14  9:36   ` Arnd Bergmann
2017-07-14 12:05   ` Dan Carpenter
2017-07-14 12:05     ` Dan Carpenter
2017-07-14 12:05     ` Dan Carpenter
2017-07-14 12:27     ` Arnd Bergmann
2017-07-14 12:27       ` Arnd Bergmann
2017-07-14 12:27       ` Arnd Bergmann
2017-07-14 12:55       ` Dan Carpenter
2017-07-14 12:55         ` Dan Carpenter
2017-07-14 12:55         ` Dan Carpenter
2017-07-14 13:09         ` Dan Carpenter
2017-07-14 13:09           ` Dan Carpenter
2017-07-14 13:09           ` Dan Carpenter
2017-07-14 19:32           ` Arnd Bergmann
2017-07-14 19:32             ` Arnd Bergmann
2017-07-14 19:32             ` Arnd Bergmann
2017-07-14 12:41   ` Dan Carpenter
2017-07-14 12:41     ` Dan Carpenter
2017-07-14 12:41     ` Dan Carpenter
2017-07-17 13:45   ` Hans Verkuil
2017-07-17 13:45     ` Hans Verkuil
2017-07-17 14:26     ` Arnd Bergmann
2017-07-17 14:26       ` Arnd Bergmann
2017-07-17 14:26       ` Arnd Bergmann
2017-07-17 14:28       ` Dan Carpenter
2017-07-17 14:28         ` Dan Carpenter
2017-07-17 14:28         ` Dan Carpenter
2017-07-17 14:32       ` Hans Verkuil
2017-07-17 14:32         ` Hans Verkuil
2017-07-17 14:32         ` Hans Verkuil
2017-07-17 14:35       ` Hans Verkuil
2017-07-17 14:35         ` Hans Verkuil
2017-07-17 14:35         ` Hans Verkuil
2017-07-17 21:23         ` Arnd Bergmann
2017-07-17 21:23           ` Arnd Bergmann
2017-07-17 21:23           ` Arnd Bergmann
2017-07-14 10:29 ` [PATCH 00/14] gcc-7 warnings Greg Kroah-Hartman
2017-07-14 10:29   ` Greg Kroah-Hartman

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='CAK8P3a3qrkZLkL=PuUHkaq9p021-Y+odTj5UrdM=dZw8L=oM8g@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jolsa@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@kernel.org \
    --cc=panand@redhat.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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.