Message ID | 20200219045423.54190-6-natechancellor@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=PuGS=4H=kvack.org=owner-linux-mm@kernel.org> 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 <patchwork-linux-mm@patchwork.kernel.org>; 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 <patchwork-linux-mm@patchwork.kernel.org>; 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 <linux-mm@kvack.org>; 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 <linux-mm@kvack.org>; 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 <linux-mm@kvack.org>; Wed, 19 Feb 2020 04:54:36 +0000 (UTC) Received: by mail-ot1-f68.google.com with SMTP id j16so21947158otl.1 for <linux-mm@kvack.org>; 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 <natechancellor@gmail.com> To: Masahiro Yamada <masahiroy@kernel.org>, Michal Marek <michal.lkml@markovi.net>, Arnd Bergmann <arnd@arndb.de>, Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>, Jason Baron <jbaron@akamai.com>, Catalin Marinas <catalin.marinas@arm.com>, Andrew Morton <akpm@linux-foundation.org> 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 <natechancellor@gmail.com> 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 Content-Transfer-Encoding: quoted-printable 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: <linux-mm.kvack.org> |
Series |
Silence some instances of -Wtautological-compare and enable globally
|
expand
|
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);
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 <natechancellor@gmail.com> --- mm/kmemleak.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)