Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4319738ybz; Mon, 20 Apr 2020 21:07:19 -0700 (PDT) X-Google-Smtp-Source: APiQypJt8W6MVx3lOWVe1goxAX9/hLiU5gISBazVMzO/1cwQeR27jlaQaP3944qpv/t3WfOh/9Hd X-Received: by 2002:a50:e8c7:: with SMTP id l7mr15853543edn.309.1587442039764; Mon, 20 Apr 2020 21:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587442039; cv=none; d=google.com; s=arc-20160816; b=k+TibSjbugOLjXG/z1qxUYmuv9CCgT560AOlcvbrSJ9gTSUvLeuGGNB48r0+hx3GKx kSCu8U9MFrAZRnKTovn0FtzTG7EG19K/bMPVT0bfYQDwBI10uIH1wtfThV9ALd+36UIp pp051AxNfDJXYB3wD/LQLsveMR6DdwfaaPA4o5A5l3FOnGUGp9O4C6GRu/+CHZ1UL4y2 4uvfq7njtNLfKycsK4cS96/ZJlBZlnUb0OMkX5Mp1n4wnSmxv1moqx1+PUzeNnpIse0l yMHyW9/xpMloMTeQ+S4Eb7rw84+EjNvhPLEY3+Ix9oblL3LbRURx/O302uvT9uhbiDIa WLPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BpkWIH/ZIkNIdAjY6+LeJFcihxi5rttWtkX9/FWTn3E=; b=ryzpf33wTrc3hDM5fWyKrP+ZErgTlPwYi9NzX/0jdCXf09DJrwknWO0k3eB3lvDJ7O 9JsCe9aaWbGTM8X/jPLmiXOLapf3STcUwZcnG9vR9i0HYvcTAbcs2d5W7/OQsAiGHe5P fE1wqFf7d2XFBB35AqWMJfeItD8qu0FbjV8iRhsbVMOmJcUNLZx3EHmm+7Uoad/Pl3c5 Lhdajl1EcJ2Gpl7SndQuf6MGhq63ztMgsLJGh4hyFez+6WGDrXTYKkr2EBCJhuQR1tIZ VGkKEuThx7Bn4xh4BJfR4cMIVDUt9XmKeCk6iInaLx6w20xkwEP619t4GCCGDiRkyAPO OHWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FGLJJlZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si805643eji.306.2020.04.20.21.06.53; Mon, 20 Apr 2020 21:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FGLJJlZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbgDUEDe (ORCPT + 99 others); Tue, 21 Apr 2020 00:03:34 -0400 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 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 346EA206CD; Tue, 21 Apr 2020 04:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587441813; bh=RgxAeo6o21slOdeo/oi5CMpvkiC62LoMPO2UXH4ytCg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FGLJJlZ/+pwYtllfiyvbICis0kR+XtiFWxk8jd4DCCrB0AVKN6G0EEvo0s3IyG5hJ OoLitET1styvnih6JBJnLm+5ftxRowAsgfZvhK8SXw2ENrQaH21ENEYQD76wP6mpJ6 QBWhmiL/3DUF0iZsaw1bADGS4Kt+owXLiEWtycFA= Date: Mon, 20 Apr 2020 21:03:32 -0700 From: Andrew Morton 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 Subject: Re: [PATCH 0/6] Silence some instances of -Wtautological-compare and enable globally Message-Id: <20200420210332.7ff9652c8bdca7fb91ccfb0c@linux-foundation.org> In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?