From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 0/6] Silence some instances of -Wtautological-compare and enable globally Date: Mon, 20 Apr 2020 21:03:32 -0700 Message-ID: <20200420210332.7ff9652c8bdca7fb91ccfb0c@linux-foundation.org> References: <20200219045423.54190-1-natechancellor@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mail.kernel.org ([198.145.29.99]:49646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgDUEDe (ORCPT ); Tue, 21 Apr 2020 00:03:34 -0400 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Nathan Chancellor Cc: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com On Tue, 18 Feb 2020 21:54:17 -0700 Nathan Chancellor wrote: > Hi everyone, > > This patch series aims to silence some instances of clang's > -Wtautological-compare that are not problematic and enable it globally > for the kernel because it has a bunch of subwarnings that can find real > bugs in the kernel such as > https://lore.kernel.org/lkml/20200116222658.5285-1-natechancellor@gmail.com/ > and https://bugs.llvm.org/show_bug.cgi?id=42666, which was specifically > requested by Dmitry. > > The first patch adds a macro that casts the section variables to > unsigned long (uintptr_t), which silences the warning and adds > documentation. > > Patches two through four silence the warning in the places I have > noticed it across all of my builds with -Werror, including arm, arm64, > and x86_64 defconfig/allmodconfig/allyesconfig. There might still be > more lurking but those will have to be teased out over time. > > Patch six finally enables the warning, while leaving one of the > subwarnings disabled because it is rather noisy and somewhat pointless > for the kernel, where core kernel code is expected to build and run with > many different configurations where variable types can be different > sizes. > For some reason none of these patches apply. Not sure why - prehaps something in the diff headers. Anyway, the kmemleak.c code has recently changed in ways which impact these patches. Please take a look at that, redo, retest and resend?