Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp876143pxk; Thu, 17 Sep 2020 20:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCO400XkqzD72N59PSsVxZ+Un6g92GTEQYB0XHMM5S0l47VURU2TZMy1ENGoJluesMDxQp X-Received: by 2002:a05:6402:16c9:: with SMTP id r9mr35521856edx.27.1600398154234; Thu, 17 Sep 2020 20:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398154; cv=none; d=google.com; s=arc-20160816; b=cEj7kzgZzGxSiPEbdvXrNUPAw0di2hKMQ0+HsmfWw7RHVx9QoX21BGW9PMoiZLI8ho 7xutsGOfLKwekdOEXJG00N+Ddy2bkPRWDQ1crZpLcA4IuRp12RUI1bwHPYdLgcFLkumi g9RMoN7DcGU/1Z/LjTdeHpRNwE8LOt+cqC98xpFC1x1sAPwOyZmSzWsGU4gcZpitSGf7 +cHmjJtuFmxuSCK2qLga3HTP2BU5XCH5GEWupCXFx+HnN+JJWuDVHO2AdGftxlRQvP8w 3oY24Ev0egVSLLQHiQ2c2zM1NNXMSvLCh2h68ASYCcdXhWbWHBrlDGbrnFTN0N7Ka12n F2Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xb2FVl6x4tf4iMi+fp2VEoKBbC/+3K9Y13vC+Pwv7dM=; b=wIBdGwK+lIIDmD/R0eB85ldLySe1bpQT3CUOCr/actO/B0VYkczsG7As8Z/9RLS+Gu +0haQ15MrjxeZGIgiLedbwxxhk4mmHxTuxwZddLhodlgT6Xr7eIb7zN0h7mBKzUnR/AL vWPlduEU8uPGCUt+fjb8TtgUG8jkscYLmYQtLkcjbQtEO4rUmkdrJ9bLz4+taZBX8trJ QJ0ZiKzsvJ4Oq1bQHdEGj/w6XNCiVU8io0gB+Y/71v07wEw4mNptzYOg8oBKcWN9R/Wt 8cGwKPNvSoksx/KiVzJkOpAS76WUIZZff2fRss16n9GecBxvGdXTM3tBijwSKrS4V7F8 Vdcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uoNu841+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr3si1292354ejb.744.2020.09.17.20.02.10; Thu, 17 Sep 2020 20:02:34 -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=uoNu841+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729527AbgIRC77 (ORCPT + 99 others); Thu, 17 Sep 2020 22:59:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:54336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727630AbgIRCFq (ORCPT ); Thu, 17 Sep 2020 22:05:46 -0400 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 E8E1C235FD; Fri, 18 Sep 2020 02:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394745; bh=QAiz8SSQum+uE9f5y9GhZrE1+yZc4mXaQiOQ4zrSM/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoNu841++zZsFkOFyY0wlu2VBBCQwfP99ljRm0LYF8o+OkA3VcJjxlUC1rlTJH9gw p+q5dN06N7EITisaV+GAM0F7RcrfoXiosEQf14hDm97BJWAx4BJjMsQ5Pa6dEUGqLt gBxFdHs4yNSa6tHJDqAR8gklx2IRg6vChZoriNHo= 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 5.4 225/330] mm/kmemleak.c: use address-of operator on section symbols Date: Thu, 17 Sep 2020 21:59:25 -0400 Message-Id: <20200918020110.2063155-225-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > _edata) ^ 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 > _edata) These are not true arrays, they are linker defined symbols, which are just 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@gmail.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 2446076633631..312942d784058 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1947,7 +1947,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); -- 2.25.1