Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdGRTzs (ORCPT ); Tue, 18 Jul 2017 15:55:48 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:33720 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021AbdGRTzp (ORCPT ); Tue, 18 Jul 2017 15:55:45 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170714092540.1217397-1-arnd@arndb.de> <20170714092540.1217397-8-arnd@arndb.de> From: Ard Biesheuvel Date: Tue, 18 Jul 2017 20:55:44 +0100 Message-ID: Subject: Re: [PATCH 07/14] proc/kcore: hide a harmless warning To: Arnd Bergmann Cc: "linux-kernel@vger.kernel.org" , Jiri Olsa , Greg Kroah-Hartman , Linus Torvalds , Tejun Heo , Guenter Roeck , IDE-ML , Linux Media Mailing List , Andrew Morton , dri-devel , Kees Cook , Ingo Molnar , Laura Abbott , Pratyush Anand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6IJtrwI029792 Content-Length: 1859 Lines: 44 On 18 July 2017 at 20:53, Arnd Bergmann wrote: > On Fri, Jul 14, 2017 at 2:28 PM, Ard Biesheuvel > wrote: >> On 14 July 2017 at 10:25, Arnd Bergmann 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. > Any idea why ccache makes a difference here? It is not obvious (not to me at least)