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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 ED2E1C001E5 for ; Mon, 12 Apr 2021 16:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF0CE61289 for ; Mon, 12 Apr 2021 16:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344778AbhDLQph (ORCPT ); Mon, 12 Apr 2021 12:45:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:38904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343741AbhDLQf4 (ORCPT ); Mon, 12 Apr 2021 12:35:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF60D613CB; Mon, 12 Apr 2021 16:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618244831; bh=uAAUyMljlcrTr7L/lCee6dkkMCsypVanYPJhHqDkpug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WliBzPiEk/vmdosDIYzcVIUd9ev85hVXyk4zVn7e2wDEJSfh/kwfFmG5JYvLvPMRk QpWQzVFBFVtDGToCyeIVvto3P40vHCopzLcymc2PACtX1HciY1vQGhiXMrdwbHZuM1 EwVEfB07SG+nj2LsShAOdSFAYGIxONa9YMQHM8cDau4JnixbLV0pqYWl3QSvZIQrM2 2Zn1QaLF7ceNW03U78gGlCPCjL2jxPauxz5PYmVqufpAL6nOYZvl2d5Xl8SonoiBO0 3v4/0WQz+yb47LnMYOSj+aaL3pEkYhdm5pFEXcisp6qI7yWCXXzmQnxR8Bj8R/XQPO bF9fJZirSw74w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , Nathan Chancellor , Santosh Shilimkar , Sasha Levin , linux-arm-kernel@lists.infradead.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 4.9 05/23] ARM: keystone: fix integer overflow warning Date: Mon, 12 Apr 2021 12:26:46 -0400 Message-Id: <20210412162704.315783-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210412162704.315783-1-sashal@kernel.org> References: <20210412162704.315783-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: Arnd Bergmann [ Upstream commit 844b85dda2f569943e1e018fdd63b6f7d1d6f08e ] clang warns about an impossible condition when building with 32-bit phys_addr_t: arch/arm/mach-keystone/keystone.c:79:16: error: result of comparison of constant 51539607551 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] mem_end > KEYSTONE_HIGH_PHYS_END) { ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ arch/arm/mach-keystone/keystone.c:78:16: error: result of comparison of constant 34359738368 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare] if (mem_start < KEYSTONE_HIGH_PHYS_START || ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~ Change the temporary variable to a fixed-size u64 to avoid the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Acked-by: Santosh Shilimkar Link: https://lore.kernel.org/r/20210323131814.2751750-1-arnd@kernel.org' Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- arch/arm/mach-keystone/keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index 84613abf35a3..79ff5b953431 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -65,7 +65,7 @@ static void __init keystone_init(void) static long long __init keystone_pv_fixup(void) { long long offset; - phys_addr_t mem_start, mem_end; + u64 mem_start, mem_end; mem_start = memblock_start_of_DRAM(); mem_end = memblock_end_of_DRAM(); @@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void) if (mem_start < KEYSTONE_HIGH_PHYS_START || mem_end > KEYSTONE_HIGH_PHYS_END) { pr_crit("Invalid address space for memory (%08llx-%08llx)\n", - (u64)mem_start, (u64)mem_end); + mem_start, mem_end); return 0; } -- 2.30.2 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,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 8584CC433ED for ; Mon, 12 Apr 2021 16:28:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C1BC61368 for ; Mon, 12 Apr 2021 16:28:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C1BC61368 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bZFBFMR4jGeaLMkwUROqbNuD/DBZx5/sxEQ32QDzAyo=; b=kUgfBxXs8+/qnSjNohYidX9gF 2gJT1TQWsX73Owj6XtL/WT68GKWOVXTDNU+59B/XuTzv4pwN00XFw9ktoFSBMSTJBxg03rFDy2TpJ wzxtRKBHP5NJghR4zxhw/Usa8F26JJjb8jshrCo+xvFVvKBtk7H8fOOCr+0mKTf/Y/wJk7eJ0Phq6 kHvL59i2r2oKmEo81JziK0sH3fMue0YX7KrxCyWxDEAI4QyAEval6cKtgjPcjuPkqtDexnsRgS2Oi dZlMbiLieLlXoTeftD/l7h01kFf/Gu0nTUzFLLRn5vM6TyCMYTpHyMNfjeK7oAmSQ3lIxUIcfMZsg qvPeEB5Zw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVzPE-007Fyd-8K; Mon, 12 Apr 2021 16:27:20 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVzP8-007FwM-P5 for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 16:27:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=0BPMkeRQuBphuD9QWLURL60mzeAamGiZT8Y7i4XsGzM=; b=bog9xQC9h8Mu5Tr1F505ABG5+v 6z7xM3PouDhBP4tVvYTi/Yk4m131SS5nfKJ7CeKTvTSrwBhhLtUiFWReQTQ+tsBfhqtsDu8ZHxPaF cKrNzzAwCL6jHnwELl16iXOTnmrwJxSM5N78wE+y0NwkFCcxKDzOpvuAY3hxztKAplaBdGNRZFhli 1eTI+excopjKIj8xPtuG6ABirhxBTAKjFbAHtoSNfkfgUQ7Lg/HFmpOjUVlEF/R3z+KkAtkR4T5nU eSd7yHmp9/+sr4FzhjYsdpNloquBA5CT0UQgfbDou2xwq7PE/TtNNXVWW38McxMtlWWPwrbUNMkcY V9o2mu/A==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVzP5-006Omu-Tn for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 16:27:13 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF60D613CB; Mon, 12 Apr 2021 16:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618244831; bh=uAAUyMljlcrTr7L/lCee6dkkMCsypVanYPJhHqDkpug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WliBzPiEk/vmdosDIYzcVIUd9ev85hVXyk4zVn7e2wDEJSfh/kwfFmG5JYvLvPMRk QpWQzVFBFVtDGToCyeIVvto3P40vHCopzLcymc2PACtX1HciY1vQGhiXMrdwbHZuM1 EwVEfB07SG+nj2LsShAOdSFAYGIxONa9YMQHM8cDau4JnixbLV0pqYWl3QSvZIQrM2 2Zn1QaLF7ceNW03U78gGlCPCjL2jxPauxz5PYmVqufpAL6nOYZvl2d5Xl8SonoiBO0 3v4/0WQz+yb47LnMYOSj+aaL3pEkYhdm5pFEXcisp6qI7yWCXXzmQnxR8Bj8R/XQPO bF9fJZirSw74w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnd Bergmann , Nathan Chancellor , Santosh Shilimkar , Sasha Levin , linux-arm-kernel@lists.infradead.org, clang-built-linux@googlegroups.com Subject: [PATCH AUTOSEL 4.9 05/23] ARM: keystone: fix integer overflow warning Date: Mon, 12 Apr 2021 12:26:46 -0400 Message-Id: <20210412162704.315783-5-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210412162704.315783-1-sashal@kernel.org> References: <20210412162704.315783-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_092711_984497_A45C7B67 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann [ Upstream commit 844b85dda2f569943e1e018fdd63b6f7d1d6f08e ] clang warns about an impossible condition when building with 32-bit phys_addr_t: arch/arm/mach-keystone/keystone.c:79:16: error: result of comparison of constant 51539607551 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] mem_end > KEYSTONE_HIGH_PHYS_END) { ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~ arch/arm/mach-keystone/keystone.c:78:16: error: result of comparison of constant 34359738368 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare] if (mem_start < KEYSTONE_HIGH_PHYS_START || ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~ Change the temporary variable to a fixed-size u64 to avoid the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Acked-by: Santosh Shilimkar Link: https://lore.kernel.org/r/20210323131814.2751750-1-arnd@kernel.org' Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- arch/arm/mach-keystone/keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index 84613abf35a3..79ff5b953431 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -65,7 +65,7 @@ static void __init keystone_init(void) static long long __init keystone_pv_fixup(void) { long long offset; - phys_addr_t mem_start, mem_end; + u64 mem_start, mem_end; mem_start = memblock_start_of_DRAM(); mem_end = memblock_end_of_DRAM(); @@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void) if (mem_start < KEYSTONE_HIGH_PHYS_START || mem_end > KEYSTONE_HIGH_PHYS_END) { pr_crit("Invalid address space for memory (%08llx-%08llx)\n", - (u64)mem_start, (u64)mem_end); + mem_start, mem_end); return 0; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel