From patchwork Wed Feb 19 04:54:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9833F924 for ; Wed, 19 Feb 2020 04:54:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 650AF24672 for ; Wed, 19 Feb 2020 04:54:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GxU8H+8w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 650AF24672 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 32D006B0006; Tue, 18 Feb 2020 23:54:34 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2DCEF6B0007; Tue, 18 Feb 2020 23:54:34 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A52B6B0008; Tue, 18 Feb 2020 23:54:34 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id 042E76B0006 for ; Tue, 18 Feb 2020 23:54:33 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 756D84405 for ; Wed, 19 Feb 2020 04:54:33 +0000 (UTC) X-FDA: 76505660826.18.shoe53_aa31a2205103 X-Spam-Summary: 2,0,0,ba85fbf3117fb812,d41d8cd98f00b204,natechancellor@gmail.com,:masahiroy@kernel.org:michal.lkml@markovi.net:arnd@arndb.de:rostedt@goodmis.org:mingo@redhat.com:jbaron@akamai.com:catalin.marinas@arm.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:linux-kbuild@vger.kernel.org:linux-arch@vger.kernel.org::clang-built-linux@googlegroups.com:natechancellor@gmail.com,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1542:1711:1730:1747:1777:1792:1981:2194:2199:2393:2525:2559:2563:2682:2685:2693:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3165:3354:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6119:6261:6653:7514:7903:8957:9025:9413:10004:11026:11473:11658:11914:12043:12048:12297:12438:12517:12519:12555:12679:12895:13161:13229:13894:14181:14394:14687:14721:21080:21433:21444:21451:21627:21666:21939:21990:30003:30054,0,R BL:209.8 X-HE-Tag: shoe53_aa31a2205103 X-Filterd-Recvd-Size: 5919 Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:32 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id z2so22579826oih.6 for ; Tue, 18 Feb 2020 20:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z4GEXAYyqQWsp025ogzeKnxOXkjpBM0jeh4Jkb1AQ/E=; b=GxU8H+8wHFYPadW4JaajZHSEVBcXNLGzyU3EcBZXx+nG/SCQ/ASmuoJLfPCPUeuTcU FPKoRZq2suxke3wLsTkQ3/gIM1UWeWVU52/tJzPsh7F9zxB1xTyPTqbDXA2XcyCzn8kA iWG/YrzUa7yE/uj8JF+ADOrARv+qXt5jGgHTl3dGWyQcvrNsChBzUM6v8hKbMjzOjbne Dv7HJtHNa1r3sg4kQxML6Nc9dqgwX2cEoYxS/8LynvMCvXhgd/YzZn9ZWcXiUNKliTpN gvs8opTGiEwt6oK3ylCI00rjpTlVbwmdaK08ckbydc41KM39Ff9Rfz2SBcq1CUbJye9R M1NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z4GEXAYyqQWsp025ogzeKnxOXkjpBM0jeh4Jkb1AQ/E=; b=GoMwayOj4OucOZ2UluFDXK6uX8tYephspgjuuC5jowkym67ESfbmK2ufVdVqgIYTRZ 9WfeMsp64yPNKhkJjk+NAULekcWxi/elA9Z7UwSseLgUdOEOpJF2j19iSrhiBZKy3mwC DPIPGUkDq7QbaK9QO0uCnKRRYfUVCftTzCE2hqkX7KSSbZYgFff5kZcTD7ulxDv+bsDt q2fGCGb+iG/WpZ6j1lOTYCvFTyLghmpjhB/dvOVuIW07XS+bwf937z3Z55DbbUySsRp0 CM7iF5aNuCcchsiYlXU0QUGmUScDnnme3fnElmQo6q0jd3p+zWMh1bABNAx5E3yZoYzA fraA== X-Gm-Message-State: APjAAAU4K8GQ6Vk6ZDAfiECxxG67jllqlpgd1RsNoOCgZT7pVEqU4/vl IDPnUise4b3Yy8J1RMHKHrM= X-Google-Smtp-Source: APXvYqzPqnhDSnUTxbnbVTbSbPmWK7BxoBMVOIdmKFVTG3pZ9TJDv5U6RijdtiI3Af1f4g1Jjlyyqw== X-Received: by 2002:aca:c7ca:: with SMTP id x193mr3514163oif.70.1582088072470; Tue, 18 Feb 2020 20:54:32 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:32 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 1/6] asm/sections: Add COMPARE_SECTIONS macro Date: Tue, 18 Feb 2020 21:54:18 -0700 Message-Id: <20200219045423.54190-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When building with clang's -Wtautological-compare, there are a few warnings around the comparison of section boundaries, which are linker defined symbols and just contain an address. Clang says that these comparisons always evaluate to a constant because it thinks they are regular arrays. This result is expected and reasonable since we just care about its boolean value. The kernel does this to figure out how exactly it was laid out during link time so that it can make certain run time decisions without hard coding them via preprocessor macros. These comparisons always evaluate the way that the kernel wants (done by comparing a Clang built kernel to a GCC built kernel). As a result, this warning should be silenced in these particular instances so that -Wtautological-compare can be enabled for the kernel globally since it brings several useful warnings within its group. In other words, by disabling -Wtautological-compare, the kernel misses out on several useful subwarnings that are found with existing static checkers; catching things with the compiler at build time will make it easier to catch issues, especially as clang starts to be integrated into CI systems. The warnings can be silenced by casting the linked defined symbols to unsigned long (normally uintptr_t but the kernel typedef's uintptr_t to unsigned long and some kernel developers prefer unsigned long) to make them purely numeric comparisons, which will be converted to a boolean without any warning from Clang. The casting is done within a macro so that it can be documented why this casting happens, rather than sprinkling random casts in the few places that this happens within the kernel. Link: https://github.com/ClangBuiltLinux/linux/issues/765 Signed-off-by: Nathan Chancellor --- include/asm-generic/sections.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index d1779d442aa5..e1f3095a50c1 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -169,4 +169,11 @@ static inline bool is_kernel_rodata(unsigned long addr) addr < (unsigned long)__end_rodata; } +/* + * Comparing section boundaries trips clang's -Wtautological-compare + * This silences that warning by making the comparisons purely numeric + */ +#define COMPARE_SECTIONS(section_one, op, section_two) \ + ((unsigned long)(section_one) op (unsigned long)(section_two)) + #endif /* _ASM_GENERIC_SECTIONS_H_ */ From patchwork Wed Feb 19 04:54:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9409930 for ; Wed, 19 Feb 2020 04:54:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A6E3424658 for ; Wed, 19 Feb 2020 04:54:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oJcPu03T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6E3424658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 577B76B0007; Tue, 18 Feb 2020 23:54:35 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 502F16B0008; Tue, 18 Feb 2020 23:54:35 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C9906B000A; Tue, 18 Feb 2020 23:54:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 25C2E6B0007 for ; Tue, 18 Feb 2020 23:54:35 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A2635181AEF1D for ; Wed, 19 Feb 2020 04:54:34 +0000 (UTC) X-FDA: 76505660868.30.boot03_acbf7c4bc838 X-Spam-Summary: 2,0,0,5d6437ee9d0afb33,d41d8cd98f00b204,natechancellor@gmail.com,,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6261:6653:7514:7903:8957:9025:9149:9413:10004:11026:11658:11914:12043:12048:12294:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13255:13311:13357:13894:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21939:30054,0,RBL:209.85.210.66:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: boot03_acbf7c4bc838 X-Filterd-Recvd-Size: 4757 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:34 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id j16so21947076otl.1 for ; Tue, 18 Feb 2020 20:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gB9HKBd9NE/ic7aLq2Zv7PAn+vedvEO6GTMd/7/cXT8=; b=oJcPu03TiqY6QgcSJwosaNcUNgizcMJBajDzA1jPGSOgixPcHSmfe23+opqORZk+vq 5uEhlpBEZOCyGWUePBMoNwLLLl0IWMPZe+VWpXNaOBx9cZ2zeUJPWQtY0dTiHewXAffD 4ifNb7wpeVSJ/pu6EVwX48D+XsoqpU25UVo48MKzoIANF1gwZwNgeaclQE8DvLhARL6C vHBM4LOnGhOmLrkDNGQWEpeKwKFqTzI1o0YnVyyE2morwLQjSjNMJuiLyIbB5rfpRg8o RWSsvGScSkalMGARf0Bb9ufIkNFTU4mFhypytRC2FcYl+1mfsPuZe3rwAIyy4dICfd5R Yt5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gB9HKBd9NE/ic7aLq2Zv7PAn+vedvEO6GTMd/7/cXT8=; b=i8QPU/YB2IOOSVoMEWQ3d+iKZ8JYcVo3SDOj3pHA4960zQvJ4uwvCK8fJLetPWil/W JLPvaFRtXnal0hmSQ3iXikXT4bRGbtTuFE325kwHKG7oE8IIfTyXRIdFJ8U9SCATiY3u 5aP2Ft0wkp5jI7CtdczKf4I1s0TRNRjDuw9l26AolAxc9BOnUOlQ0LaSfIIuYQCs/XCk 1pkfhsuKVd6GxitYARihdyzIw+p5CIum+MTaD2WWBJD324YFW9yXHObRUHgpaNm7V3Fz q3Ii3A/BjQBeDFzjcXD3EYYjjF9cDGGxb9yDSzZvfMuA0XC30C6lRU75jSUWDkMq3wyd uPhg== X-Gm-Message-State: APjAAAV8NbyEFCmBIOmajL0v0wBM/y1Hu1tjeIQXGj6+xS2ir2ODnNhk r1CNE0/6e+QnnyMVjMa/Uts= X-Google-Smtp-Source: APXvYqwdFwp4qn7ny2TvCGnaQaQjscbRAz+omD8OlFFTCu1L1VgwqztyBfFMZgIeIPZS92nhreHqNA== X-Received: by 2002:a9d:6b12:: with SMTP id g18mr17801067otp.211.1582088073480; Tue, 18 Feb 2020 20:54:33 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:32 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 2/6] kernel/extable: Wrap section comparison in sort_main_extable with COMPARE_SECTIONS Date: Tue, 18 Feb 2020 21:54:19 -0700 Message-Id: <20200219045423.54190-3-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Clang warns: ../kernel/extable.c:37:52: warning: array comparison always evaluates to a constant [-Wtautological-compare] if (main_extable_sort_needed && __stop___ex_table > __start___ex_table) { ^ 1 warning generated. These are not true arrays, they are linker defined symbols, which are just addresses so there is not a real issue here. Use the COMPARE_SECTIONS macro to silence this warning by casting the linker defined symbols to unsigned long, which keeps the logic the same. Link: https://github.com/ClangBuiltLinux/linux/issues/765 Signed-off-by: Nathan Chancellor --- kernel/extable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/extable.c b/kernel/extable.c index a0024f27d3a1..17bf4ccb9de9 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -34,7 +34,8 @@ u32 __initdata __visible main_extable_sort_needed = 1; /* Sort the kernel's built-in exception table */ void __init sort_main_extable(void) { - if (main_extable_sort_needed && __stop___ex_table > __start___ex_table) { + if (main_extable_sort_needed && + COMPARE_SECTIONS(__stop___ex_table, >, __start___ex_table)) { pr_notice("Sorting __ex_table...\n"); sort_extable(__start___ex_table, __stop___ex_table); } From patchwork Wed Feb 19 04:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390335 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37015930 for ; Wed, 19 Feb 2020 04:54:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03E2C24656 for ; Wed, 19 Feb 2020 04:54:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RlTQIa8C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03E2C24656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BE4176B0008; Tue, 18 Feb 2020 23:54:35 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B1B4C6B000A; Tue, 18 Feb 2020 23:54:35 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 970026B000C; Tue, 18 Feb 2020 23:54:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id 7F6656B0008 for ; Tue, 18 Feb 2020 23:54:35 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F08AE180AD817 for ; Wed, 19 Feb 2020 04:54:34 +0000 (UTC) X-FDA: 76505660910.23.unit95_adf0a929ce34 X-Spam-Summary: 2,0,0,886271c9b107fcdf,d41d8cd98f00b204,natechancellor@gmail.com,:masahiroy@kernel.org:michal.lkml@markovi.net:arnd@arndb.de:rostedt@goodmis.org:mingo@redhat.com:jbaron@akamai.com:catalin.marinas@arm.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:linux-kbuild@vger.kernel.org:linux-arch@vger.kernel.org::clang-built-linux@googlegroups.com:natechancellor@gmail.com,RULES_HIT:41:355:379:541:800:960:966:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:2196:2199:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4385:4605:5007:6261:6653:7514:7903:8957:9025:9413:10004:11026:11658:11914:12043:12048:12114:12294:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13255:13311:13357:13894:14096:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21939:30054,0,RBL:209.85.1 67.196:@ X-HE-Tag: unit95_adf0a929ce34 X-Filterd-Recvd-Size: 4723 Received: from mail-oi1-f196.google.com (mail-oi1-f196.google.com [209.85.167.196]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:34 +0000 (UTC) Received: by mail-oi1-f196.google.com with SMTP id p125so22564882oif.10 for ; Tue, 18 Feb 2020 20:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dr2Q+aHg/1SGjzpWBsBNv11ATwozDGCBBkaKKg29VLU=; b=RlTQIa8CRCM+VNzdVRfUcZhF+5zjAHPs4z0EywqhlgDJhQIBms6nhmImjyHTTHYkOy kAE1qCHWRhwFAjVqLvaXZJa49nISb8dLeexOQVcMXPsAchxmy08bxmlmomC0ljC4G6r/ TPAs3CCUKPBkIrP/fhQdDQthulzH5Mx98wdmPnKA4kQLIIZVOm1iycVFu/zwQzT6lvAs IAELIMXwPbuzc3ConrlHpGVxcz4GPCA6jwhoQCgJFAH91pN7I24IxHQJoVQwmxq+q/US yFqU1TwG+sb6fsmvXFmjg9uYEDKwyxy2qReN/DutUyQQASjz7GWVWs8oeR5tslTVZTNO Bd0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dr2Q+aHg/1SGjzpWBsBNv11ATwozDGCBBkaKKg29VLU=; b=UxwCwSckjyxJ6fSMRSK7d6qf6iEABPzza49nPvMvjCj8OL9Fh+dfODM4M+WcehSON2 EZUq+SfTP6Lu4FlphvEVLPSn9LRPISqf7FhA5o5XelX06U1w4nYJOEjpyE0lskpTtMl8 na50q61bYan7/SrXcmIK+y/jql0cRy2Tx+5WNDMx0PZKlY8BpqUIcQIFrJkM0oRTlZ/6 QAcWATPl/LbWpzvW+gqiAQHhBAzgJUySjrLO1fwfApcA3QMqkcjSEO+7R+Nfs6wb97TO Z/N5hKXbLgrkCobiCpbesyaDBAL3KEKhhdq+iXbfBVoSJDyl0lD9U3MtygH8G0ke1QKD wfCg== X-Gm-Message-State: APjAAAUTl/QOvJz8veu6en8x+UWoPZ6HgdgmKswNUIir/zK05rcTUA1f OQc8v95hrAmh5JhDpksB1QGDCF4R X-Google-Smtp-Source: APXvYqxyb3BnXAjNQrjcn8HqOmkV+kjEbAKY9iDmYxHQnfG5ebZsrdug8IdEe5BqVTLiXeR2InjgJQ== X-Received: by 2002:aca:5dc3:: with SMTP id r186mr3577268oib.137.1582088074161; Tue, 18 Feb 2020 20:54:34 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:33 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 3/6] tracing: Wrap section comparison in tracer_alloc_buffers with COMPARE_SECTIONS Date: Tue, 18 Feb 2020 21:54:20 -0700 Message-Id: <20200219045423.54190-4-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Clang warns: ../kernel/trace/trace.c:9335:33: warning: array comparison always evaluates to true [-Wtautological-compare] if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) ^ 1 warning generated. These are not true arrays, they are linker defined symbols, which are just addresses so there is not a real issue here. Use the COMPARE_SECTIONS macro to silence this warning by casting the linker defined symbols to unsigned long, which keeps the logic the same. Link: https://github.com/ClangBuiltLinux/linux/issues/765 Signed-off-by: Nathan Chancellor --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index c797a15a1fc7..e1f3b16e457b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9332,7 +9332,7 @@ __init static int tracer_alloc_buffers(void) goto out_free_buffer_mask; /* Only allocate trace_printk buffers if a trace_printk exists */ - if (__stop___trace_bprintk_fmt != __start___trace_bprintk_fmt) + if (COMPARE_SECTIONS(__stop___trace_bprintk_fmt, !=, __start___trace_bprintk_fmt)) /* Must be called before global_trace.buffer is allocated */ trace_printk_init_buffers(); From patchwork Wed Feb 19 04:54:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82711924 for ; Wed, 19 Feb 2020 04:54:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F9F924656 for ; Wed, 19 Feb 2020 04:54:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CGR/0y06" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F9F924656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D8DA46B000A; Tue, 18 Feb 2020 23:54:36 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D3F326B000C; Tue, 18 Feb 2020 23:54:36 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B92F36B000D; Tue, 18 Feb 2020 23:54:36 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id A21196B000A for ; Tue, 18 Feb 2020 23:54:36 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2CA608248047 for ; Wed, 19 Feb 2020 04:54:36 +0000 (UTC) X-FDA: 76505660952.28.drop67_b060a76e285a X-Spam-Summary: 2,0,0,643d21c01ad31b3a,d41d8cd98f00b204,natechancellor@gmail.com,:masahiroy@kernel.org:michal.lkml@markovi.net:arnd@arndb.de:rostedt@goodmis.org:mingo@redhat.com:jbaron@akamai.com:catalin.marinas@arm.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:linux-kbuild@vger.kernel.org:linux-arch@vger.kernel.org::clang-built-linux@googlegroups.com:natechancellor@gmail.com,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6261:6653:7514:7903:7904:8957:9025:9413:10004:11026:11473:11658:11914:12043:12048:12294:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13161:13229:13255:13311:13357:13894:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21939:21990:30054,0,RBL:209.85 .210.66: X-HE-Tag: drop67_b060a76e285a X-Filterd-Recvd-Size: 4601 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:35 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id r27so21881269otc.8 for ; Tue, 18 Feb 2020 20:54:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5UFOi8jLMJhZKfbS1bLXcN2MTOzPVzspy8Ufb+K/+9A=; b=CGR/0y06bDux3uipIKmL2A6gq/Cjwnfz6TpotKAct40JBSC1dCgyK/xpIMrUuQqODG ndabVlZXu3nu5sDRXd5T6gc+0Z5fnGquP6EpnNzE86kWuGTBiNeWK9EQAry7s3uaNTb6 eGn2yiX29eXa/P82eFd5E4QAdhju0gshmPP1AuAgAxgIEllQg0iQsrb+ECFDI2+AvB9r +fQurI2f1KQsm6vtGkq+TCmq4jlPB/gWa1h33C20pXb5fZ5KIAZ4UcmMoGzUaiHRI5mH kog8lhdtN1kfcA5LAqLn0c6uFsltFxkqPIXvqql6Pzi81xN5aIMqpQ4LObP47x/z4Yhq yUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5UFOi8jLMJhZKfbS1bLXcN2MTOzPVzspy8Ufb+K/+9A=; b=RvR6qNhxhS7v+ucdq8A3WcI6Xr/O8SxZIqjhs1WZNBGPLqs++0mif+vQ8vzCIiVebA FMHOfm9rFZIw4sCPwz1rerLXR//36fZuFrPHB3pDkVrX+NjogaMW+SQkc86zfgItLt2X ceOR9Duhrh/FUAQ4tXK0eTlt8I45j5e37vp5Ik7DlhI5NzUxSWZ6l0v+uD0SxIrEbXBG HtlumgEP15Nm6iJgsbkoHDjgP2t+VJQVxMCWHIRkvJUY+IiZfnVnB//HTkvx4GexxGQy tqny/gJo8ts7rFzepxjonNv1WMLykf6sG4lKqLouT+c0GB7kkYpvnh/+cI+fMLuigvh5 1v1Q== X-Gm-Message-State: APjAAAXH6Cdz/8bfGlMDLd+t2/s7eLV7h15lI+atyNFvQdmVlo+vIuiC QqQSCjDDVU1oIwvrnmUyPvw= X-Google-Smtp-Source: APXvYqyYvjiYUbVKqo1foePiJ1LRz3yob4g25LDX4h9uBovWKx7QdkcX8t6eDUmuVpPdUDin0haoFw== X-Received: by 2002:a9d:7dc9:: with SMTP id k9mr18133478otn.117.1582088075110; Tue, 18 Feb 2020 20:54:35 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:34 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 4/6] dynamic_debug: Wrap section comparison in dynamic_debug_init with COMPARE_SECTIONS Date: Tue, 18 Feb 2020 21:54:21 -0700 Message-Id: <20200219045423.54190-5-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Clang warns: ../lib/dynamic_debug.c:1016:24: warning: array comparison always evaluates to false [-Wtautological-compare] if (__start___verbose == __stop___verbose) { ^ 1 warning generated. These are not true arrays, they are linker defined symbols, which are just addresses so there is not a real issue here. Use the COMPARE_SECTIONS macro to silence this warning by casting the linker defined symbols to unsigned long, which keeps the logic the same. Link: https://github.com/ClangBuiltLinux/linux/issues/765 Signed-off-by: Nathan Chancellor --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index aae17d9522e5..c7350aa6e853 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1031,7 +1031,7 @@ static int __init dynamic_debug_init(void) int n = 0, entries = 0, modct = 0; int verbose_bytes = 0; - if (__start___verbose == __stop___verbose) { + if (COMPARE_SECTIONS(__start___verbose, ==, __stop___verbose)) { pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n"); return 1; } From patchwork Wed Feb 19 04:54:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCF70930 for ; Wed, 19 Feb 2020 04:54:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AA01424656 for ; Wed, 19 Feb 2020 04:54:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J/JOa0IR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA01424656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E530A6B000C; Tue, 18 Feb 2020 23:54:37 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DDA396B000D; Tue, 18 Feb 2020 23:54:37 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCC896B000E; Tue, 18 Feb 2020 23:54:37 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id B035B6B000C for ; Tue, 18 Feb 2020 23:54:37 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 35AFD2C2E for ; Wed, 19 Feb 2020 04:54:37 +0000 (UTC) X-FDA: 76505660994.08.wish29_b2b1ccfdc92a X-Spam-Summary: 2,0,0,aae52e9100e9b2cd,d41d8cd98f00b204,natechancellor@gmail.com,:masahiroy@kernel.org:michal.lkml@markovi.net:arnd@arndb.de:rostedt@goodmis.org:mingo@redhat.com:jbaron@akamai.com:catalin.marinas@arm.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:linux-kbuild@vger.kernel.org:linux-arch@vger.kernel.org::clang-built-linux@googlegroups.com:natechancellor@gmail.com,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1359:1437:1515:1535:1541:1711:1730:1747:1777:1792:1801:2393:2525:2559:2563:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3867:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6261:6653:7514:7903:8957:9025:9149:9413:10004:11026:11658:11914:12043:12048:12294:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13161:13229:13255:13311:13357:13894:13972:14096:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21939:30054,0,RBL:209.85.210. 68:@gmai X-HE-Tag: wish29_b2b1ccfdc92a X-Filterd-Recvd-Size: 5079 Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:36 +0000 (UTC) Received: by mail-ot1-f68.google.com with SMTP id j16so21947158otl.1 for ; Tue, 18 Feb 2020 20:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jXMSq1G5rPTXUEP5geAUCtTmXJBdNGAIZfUMzXa3xpk=; b=J/JOa0IRUSQzS/wfLNZGUESDgz1LVTCC8zLL4GgLJN3TkqqBKqbwTtKzVV+LKQA/ow Ctahh1xRv+Cjvv8ps3OzOLyz0wsgaXJYVIUktvu7gxbtjoVSvKOjLPBf2kHlscZCiHiN rabnjLDU1PUlEMJAtn6k1Zde4XJg6WcwaOUl2cBKDUlCkAiaN0aRXU7B1+fST7KgxUc8 plxxVegSLtHSF2Kpo7GnyPEjvBEqw4jusa3DIb+rb9MEpwvSQsLaH834lRk7M/UNPdnw AMNyVfRD1iwflZr8McSRr6QzaZzvWMNXySOrrLThSzklcMr35jGETEW9goqvDy0a1lYR 8tPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jXMSq1G5rPTXUEP5geAUCtTmXJBdNGAIZfUMzXa3xpk=; b=IE7Oc++SxtLaXQzQOksCVULsfFU/14HL1+FRccgNLG+qqTIVlfnOxIPimys8A3S1UN TCUJFhv0XdnrG2QMcNvZMr2h3UHEYqhjoOofU/5I5H0wYLC1auja3CVHiQSox3g4fF2q nlzbtRUvjPDQXZoKLUjNiU/q2TCwGWWEU7ZF4K0GdD98/L3ROAsuJtubmRtWdLk/TAB1 rFCbzaF/V4ES3DrT84A/LrasRW+U/IyYK0cKvu7t6zW9+cJaBF4p7xh+N8IlYwYFWufI d1Wjc+IBQRx8s7pj6HAOpITx0uqUIn16Hf0lol0SN47MHvCvEQ+uqHsHGCz+JykcrPoz KWPQ== X-Gm-Message-State: APjAAAUJmKSI6y0GDd3tx5QVxqCyJKluW2s6SimObIAals4dIvN2TTaZ JHWcZ+HUljMqCfraD/Nk3Zw= X-Google-Smtp-Source: APXvYqzGvAZO0x9jw5WmNLprzgTxW6R8oyixD2CIDl8AUW+oyej/NaXt3g2Xbd0NMuq30pnEIYLxNQ== X-Received: by 2002:a9d:6415:: with SMTP id h21mr19176451otl.152.1582088076125; Tue, 18 Feb 2020 20:54:36 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:35 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 5/6] mm: kmemleak: Wrap section comparison in kmemleak_init with COMPARE_SECTIONS Date: Tue, 18 Feb 2020 21:54:22 -0700 Message-Id: <20200219045423.54190-6-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Clang warns: ../mm/kmemleak.c:1950:28: warning: array comparison always evaluates to a constant [-Wtautological-compare] if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata) ^ ../mm/kmemleak.c:1950:60: warning: array comparison always evaluates to a constant [-Wtautological-compare] if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata) ^ 2 warnings generated. These are not true arrays, they are linker defined symbols, which are just addresses so there is not a real issue here. Use the COMPARE_SECTIONS macro to silence this warning by casting the linker defined symbols to unsigned long, which keeps the logic the same. Link: https://github.com/ClangBuiltLinux/linux/issues/765 Signed-off-by: Nathan Chancellor --- mm/kmemleak.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index aa6832432d6a..e27655526ba7 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1952,7 +1952,8 @@ void __init kmemleak_init(void) create_object((unsigned long)__bss_start, __bss_stop - __bss_start, KMEMLEAK_GREY, GFP_ATOMIC); /* only register .data..ro_after_init if not within .data */ - if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata) + if (COMPARE_SECTIONS(__start_ro_after_init, <, _sdata) || + COMPARE_SECTIONS(__end_ro_after_init, >, _edata)) create_object((unsigned long)__start_ro_after_init, __end_ro_after_init - __start_ro_after_init, KMEMLEAK_GREY, GFP_ATOMIC); From patchwork Wed Feb 19 04:54:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11390341 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F39D930 for ; Wed, 19 Feb 2020 04:54:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 032202467C for ; Wed, 19 Feb 2020 04:54:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WBwXIcH5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 032202467C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACE196B000D; Tue, 18 Feb 2020 23:54:38 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A80F36B000E; Tue, 18 Feb 2020 23:54:38 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 997F66B0010; Tue, 18 Feb 2020 23:54:38 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 7BCB96B000D for ; Tue, 18 Feb 2020 23:54:38 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0F839181AEF1D for ; Wed, 19 Feb 2020 04:54:38 +0000 (UTC) X-FDA: 76505661036.09.week60_b4c4c928f44f X-Spam-Summary: 2,0,0,3c9b2589e4d65b28,d41d8cd98f00b204,natechancellor@gmail.com,:masahiroy@kernel.org:michal.lkml@markovi.net:arnd@arndb.de:rostedt@goodmis.org:mingo@redhat.com:jbaron@akamai.com:catalin.marinas@arm.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:linux-kbuild@vger.kernel.org:linux-arch@vger.kernel.org::clang-built-linux@googlegroups.com:natechancellor@gmail.com,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1263:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2525:2559:2564:2682:2685:2693:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3868:3870:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:5007:6261:6653:7514:8599:8603:8957:9025:9413:10004:10049:11026:11232:11473:11658:11914:12043:12048:12295:12296:12297:12438:12517:12519:12555:12679:12776:12895:12986:13069:13161:13229:13311:13357:13894:14096:14181:14384:14394:14687:14721:14849:21080:21444:21451:21627:21 666:2193 X-HE-Tag: week60_b4c4c928f44f X-Filterd-Recvd-Size: 4955 Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 04:54:37 +0000 (UTC) Received: by mail-ot1-f65.google.com with SMTP id r27so21881294otc.8 for ; Tue, 18 Feb 2020 20:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oh9QWb6pZZ5g69dU4FZ2txutGr0B2CSvIaPTiYXdnPo=; b=WBwXIcH52wj5UStzSlDaw2Ph8pzj/CYP3JRSbf54GZh79pza3d3RsxczDsukrXWSZ7 86khT4brEkZbiwPESK+rtMahwlr7gE+9fQ0NRJakjryJkgDvh9ACjcNovCc0J9Sy5zll 88LmmWVIvK2n273H7MJxpeDiBFbG2x5vk5wpwRXdCTotbpecqAQ1qdXfoQlb9uRU2yC6 AvaBlQeWFdJnomzIM4hTbQfiEfCtrzQIMaRLgjQ8s6iN9JZCPEhU2N1slMVrr1UU1AB5 El1e5Hnaz3m5KCaZqWo0pgU+ojOgoCdxbASQRLncZppeIXyvOm7iU+Zj2f6dMYh6cEHr 9hIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Oh9QWb6pZZ5g69dU4FZ2txutGr0B2CSvIaPTiYXdnPo=; b=t+9f/8Z3fLTfuZnC8OmerWcg6+NLHxGhji1QiNBLusPoIwXGK5SsYkEmUoNv9bOVep 0I1MiwOtB1j92hJspZMMX5skPb8TOGmt95sL82E0obnsnqLVtSGeADfsCTrkFfCBM5R8 jvH9ByrtKaI6muqyfKu01MwfF55Fh+ZA1LLMTPL1RvycUnLP7Rwe8I8HmcXeH+100JX0 MqTAFCT0pNUq/j+5JC7mF0+VFqQ1gUYbw5r5xkQPUdSEyjUPyOcAxvC+wfci+VcySG3A kpmMihJEIEjW+kv2hGXyqDHdw3ARktcmgOIkhO3EhiPV4qeh1VfUfUs/u/dWDI7S62xW FsIQ== X-Gm-Message-State: APjAAAVpy8m/fjByRl6R3K1PJSOSUud9bX2TSH6f0juT/421Aw+ZSAAz dgOR501uaeTtDtgxHPxqGu8= X-Google-Smtp-Source: APXvYqxJRG2OQXc05asgj7HXthiAW2UIejHZq7541ZiIpdLqpMSEi/rSorSHXLJ0a/aaTltGwjj13Q== X-Received: by 2002:a05:6830:1d91:: with SMTP id y17mr17502659oti.276.1582088077039; Tue, 18 Feb 2020 20:54:37 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c7sm288894otn.81.2020.02.18.20.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 20:54:36 -0800 (PST) From: Nathan Chancellor To: Masahiro Yamada , Michal Marek , Arnd Bergmann , Steven Rostedt , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 6/6] kbuild: Enable -Wtautological-compare Date: Tue, 18 Feb 2020 21:54:23 -0700 Message-Id: <20200219045423.54190-7-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200219045423.54190-1-natechancellor@gmail.com> References: <20200219045423.54190-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Currently, we disable -Wtautological-compare, which in turn disables a bunch of more specific tautological comparison warnings that are useful for the kernel (see clang's documentation below). Now that all of the major/noisy warnings have been fixed, enable -Wtautological-compare so that more issues can be caught at build time. -Wtautological-constant-out-of-range-compare is kept disabled because there are places in the kernel where a constant or variable size can change based on the kernel configuration; these are not fixed in a clean/concise way and they are almost always harmless so this one subwarning is kept disabled. Link: https://github.com/ClangBuiltLinux/linux/issues/488 Link: http://releases.llvm.org/9.0.0/tools/clang/docs/DiagnosticsReference.html#wtautological-compare Signed-off-by: Nathan Chancellor --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b954c304c479..99080c57a1cb 100644 --- a/Makefile +++ b/Makefile @@ -742,8 +742,7 @@ ifdef CONFIG_CC_IS_CLANG KBUILD_CPPFLAGS += -Qunused-arguments KBUILD_CFLAGS += -Wno-format-invalid-specifier KBUILD_CFLAGS += -Wno-gnu -# Quiet clang warning: comparison of unsigned expression < 0 is always false -KBUILD_CFLAGS += -Wno-tautological-compare +KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the # source of a reference will be _MergedGlobals and not on of the whitelisted names. # See modpost pattern 2