From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74F3EC43464 for ; Fri, 18 Sep 2020 02:13:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20269239E5 for ; Fri, 18 Sep 2020 02:13:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="FuK+Hx/R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20269239E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 862B16B00A2; Thu, 17 Sep 2020 22:13:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 812B26B00A3; Thu, 17 Sep 2020 22:13:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DCD36B00A4; Thu, 17 Sep 2020 22:13:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 58C416B00A2 for ; Thu, 17 Sep 2020 22:13:58 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 22321181AEF00 for ; Fri, 18 Sep 2020 02:13:58 +0000 (UTC) X-FDA: 77274561756.01.value39_0e08cc727127 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id EE76F100483EF for ; Fri, 18 Sep 2020 02:13:57 +0000 (UTC) X-HE-Tag: value39_0e08cc727127 X-Filterd-Recvd-Size: 3723 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Sep 2020 02:13:57 +0000 (UTC) Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC83E239EE; Fri, 18 Sep 2020 02:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395236; bh=0u/2lLeQmbDvSCvC7de5B3F7KhtSvQEvgXMoKY3Pb0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FuK+Hx/R1155yxhwOrBA7df/dyV2RanJq5AAaqrBleHPhCpWMZYQTm8OQ5s9l2EKK y4pdZWQVN6uwJzEotFud2umIg1yi7wNErteGZL2wpgxaECwOsDN4cYuJNnhVzkbi9/ ntMB0pGz6L6NXPaOt+fh+l4lIV3tecG0v/1RmPu0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Nick Desaulniers , Andrew Morton , Catalin Marinas , Linus Torvalds , Sasha Levin , linux-mm@kvack.org Subject: [PATCH AUTOSEL 4.14 081/127] mm/kmemleak.c: use address-of operator on section symbols Date: Thu, 17 Sep 2020 22:11:34 -0400 Message-Id: <20200918021220.2066485-81-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918021220.2066485-1-sashal@kernel.org> References: <20200918021220.2066485-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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: From: Nathan Chancellor [ Upstream commit b0d14fc43d39203ae025f20ef4d5d25d9ccf4be1 ] Clang warns: mm/kmemleak.c:1955:28: warning: array comparison always evaluates to a = constant [-Wtautological-compare] if (__start_ro_after_init < _sdata || __end_ro_after_init > _edat= a) ^ mm/kmemleak.c:1955:60: warning: array comparison always evaluates to a = constant [-Wtautological-compare] if (__start_ro_after_init < _sdata || __end_ro_after_init > _edat= a) These are not true arrays, they are linker defined symbols, which are jus= t addresses. Using the address of operator silences the warning and does not change the resulting assembly with either clang/ld.lld or gcc/ld (tested with diff + objdump -Dr). Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Andrew Morton Acked-by: Catalin Marinas Link: https://github.com/ClangBuiltLinux/linux/issues/895 Link: http://lkml.kernel.org/r/20200220051551.44000-1-natechancellor@gmai= l.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index d779181bed4d8..706f705c2e0a4 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -2030,7 +2030,7 @@ 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 (&__start_ro_after_init < &_sdata || &__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); --=20 2.25.1