From patchwork Mon Apr 19 13:05:35 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: 423989 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp2712064jaf; Mon, 19 Apr 2021 06:18:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLPv+GLzx42cZgclCKzbLPI5up7kqWjCAEaQmpsOKxH27Vp45HKuHyiAVGNvVJzTkJ/Xez X-Received: by 2002:a17:90a:4a8e:: with SMTP id f14mr25665101pjh.20.1618838310326; Mon, 19 Apr 2021 06:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618838310; cv=none; d=google.com; s=arc-20160816; b=zUqovpm5yog9+goFufVIQ7juTHWklTQ4kJT0VnbM1z5dfMKCPo0jyFhzy8VosgJX9d RA6iIvhsRZw4ruTZgmZZRVU3jLZV/mVYMrRbqcAeQESglcY6wFyif5QzwItY7MO9iDDM EZyRFitu4n4QrNnGqSdjFSg/8hviXD3tCZ2B1Pgj1gNKeL9T2w+U90xqiOptASs6hR3G XL39CR72gOqeqFNURPlLiy8CQ6ZxKkkkgAK1lbPeb9kOt+heAVEsaWE9OpZi0g2LAGIn iQ1uR/zUGYTjxHrbMXlWim0zHoejAI46ouBVBK4U67Zu4HS/MeB+aqugeCfVeAKbcHgT g+KQ== 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=w+BoW5Kpcs2fs8Jj5nQrJ0bk3hbZ3Q3GqeBb1nmyV44=; b=z0ZMxMJClnuLIWu3VI2Ok6yJysKngEjIolFMXnuCTl6q6mX2b4COyomrKEnmUUxfRg hDzSqE7Vx6JjwwNQSTx2KNZFrV9oA/CreukR5hxdsSgRNppJ1xdxi3nxas/G0Lm9l5zm uPxcX0cg8OPU7hIgqu18jFwRCIq6VTfGEIVajQi3ompT/bZHUTz/8C1tiakspuXFHxar m4RG2BKhqKsldxpvEhxMSognukyKA4KHeQ8Djd/hg5EpD714igxgNFLi9jXWAdcc7QWM iQGcK0Zz9/GNWgJNAF2sJutojRg27aXvtUoEcvJOMZ3gsuBYNquUL8KjYyb0R0YISJDz EKHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wyEji5KP; 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 k1si5096119pgq.470.2021.04.19.06.18.30; Mon, 19 Apr 2021 06:18:30 -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=wyEji5KP; 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 S237650AbhDSNSw (ORCPT + 12 others); Mon, 19 Apr 2021 09:18:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239716AbhDSNQ6 (ORCPT ); Mon, 19 Apr 2021 09:16:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF6AC613BC; Mon, 19 Apr 2021 13:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838049; bh=gGfp787/qmdbfVUNOVwLZC98q1V8+vZDiG8DwRfu/+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wyEji5KP8pIPe/qzBdU+sU79XKyGNpTu80vr4CoLVsLrXva8fCAYSVfSRT+abp/od Ln+SgC1ONWNU2EfvGlItIrcRH8M3Lf8M7Lsge3VRnd5JO99XpNwzEmWCCs8bCiHTDW je9oy6YzOgu9dvbu910uPhKr8l0tu12RcQ8mZwrU= 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.10 024/103] ARM: keystone: fix integer overflow warning Date: Mon, 19 Apr 2021 15:05:35 +0200 Message-Id: <20210419130528.621955805@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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 09a65c2dfd73..b8fa01f9516e 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; }