From patchwork Mon Apr 19 13:06:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 423994 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp2719024jaf; Mon, 19 Apr 2021 06:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWhL5Wms2fIORb4+Jg/Md4T8c/H93/A0v0HlFJfGbQO9kXIx0Sbe1qzWsz3DKMeDG7uILz X-Received: by 2002:a17:906:26c9:: with SMTP id u9mr21781454ejc.520.1618838801326; Mon, 19 Apr 2021 06:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618838801; cv=none; d=google.com; s=arc-20160816; b=o9MkGC2KT3rjRMmsw1Z3JDZTREOTToYkBtje0kKhY44XUo51sRV4EIZvProzr5e8sv TcbVhO3APiC3UvhrRU3GxTH5D5DVfQz+TT87i9NOMomE2ELJTpjMdT91O/h8YxheVzDE 9yRI2hECg01AJjaZDfoIgsZkBeJjq8IbWEAB0V7SriGU2JYl5er0Hi+kvJK/bdy0V6fa /198pSCz6iI7btQhfpKfeIRRrqSBuoWmA7fEocAZsznilvifXI5UkKLubYVhH5Mk3qL+ yWYR14Gjb1QPhvMRYkwp68o/Q64fucGGgLpyDvE+79uIrtLMki7nWdENQVQqsXW17kV0 1zLg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FwcIDdsegnGCXCqnBoygOLgRR9sFCJRpRFHHcyztj/k=; b=WRb4nZHH1/XOfvl2GDTjywngj2xWkbG6RyzIeClKPrFrBOpuZZLSbHhVEXKzfQKai0 yZRlFph7y2ISH/xXPYHNGmefT0sB8yBDUCKpRrdt+BFxCOSqPiKsQuG2CIoDxI7Y1nVp 20CdqkA7U0rfGSEOR9EfDud8cob7z5ESv+J5bjHdgLCY83DiO3EqJVI4GoVbrPkqSqo9 Y9k3nsjvrJCFwkHO3XRz0wEsPKQ9n9efkGCPQM5QODAyFsXXGGLPq31eelAyZ2Wshoxg 4oO7ycupL5AZCZWpBdJ0xoZQoV+3I+8uOLpV+e3ubID/qoC+WBiWJorL26TqrdPvbuvJ 0LLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ODhtMW72; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt19si12204115ejc.144.2021.04.19.06.26.41; Mon, 19 Apr 2021 06:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=ODhtMW72; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242144AbhDSNZX (ORCPT + 12 others); Mon, 19 Apr 2021 09:25:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:34120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241612AbhDSNXK (ORCPT ); Mon, 19 Apr 2021 09:23:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B93D613D4; Mon, 19 Apr 2021 13:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838322; bh=usuTaktM1ZOp8ejTe81d6kyd+a45IP9igXcBJl+YYyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ODhtMW721CLbU3TOlOVDdX9Z+bP3noIhJ6WeIb8tGlUrXYdJokhVbqfeQmRNlJ3vK NUcduxjeCSAvVf0ILSxIzWpKd8Lh93Xptu8/feMco7qXMd3/ZzIkU7opolYckAEiI8 rSsMegBILzGnHzkPNrTRRuwZgoB3TpgB569WczA8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , Santosh Shilimkar , Sasha Levin Subject: [PATCH 5.4 19/73] ARM: keystone: fix integer overflow warning Date: Mon, 19 Apr 2021 15:06:10 +0200 Message-Id: <20210419130524.442384383@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130523.802169214@linuxfoundation.org> References: <20210419130523.802169214@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index 638808c4e122..697adedaced4 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -62,7 +62,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(); @@ -75,7 +75,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; }