From patchwork Mon Apr 26 07:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 427520 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3460754jao; Mon, 26 Apr 2021 00:36:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtsrG6jrUApeCh8ANQM/+rETjw1jiqRGAK3WkfUzCgHuVUxVXWpJq0OoOlgPeOzKUkP3At X-Received: by 2002:a17:90a:f0d5:: with SMTP id fa21mr19707228pjb.59.1619422611109; Mon, 26 Apr 2021 00:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619422611; cv=none; d=google.com; s=arc-20160816; b=CFBNArVY2rp/i2ShDl3bNDn3uXFNAP1MbnqTKCzFH+3K5t+vXrEVDY1QVzZYV06ZJn 5wBkqskpfsBC2bAuBDIL1J+KAB0qlnVpqkEcVdtUmodOjXZuxPMgTO6KzqpvN2AhuUll 5bTsOy6GP0GZ4O8H0DTG3SgehR0S7aHEu3KLax/SNwGGDMgZ72mAFQLAKqstocJfJh68 j+ValfEkDpixAQnmfDRXwieaqhw1QGfupVxLDzGFyQJwoTjf5XuUWRQXin7PP87XUxb3 AexoiA/S8dfROEJgccanexh747qhNQkl2QhRo+i2Sbg/TsgqDnjrmDsuH8Q0tENvYOEW I15A== 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=0BPMkeRQuBphuD9QWLURL60mzeAamGiZT8Y7i4XsGzM=; b=0wqWMQLh13ZkBHb/hLjCth0jA6tgpGGPx2zXtTqz/zQazarsimQNTWKd5hwvaXtfMs H9VMAp1WEbRTEUB66cZDkjG7ix1Zs9Q318asvZ+JVhcIAFid4M33ncMIgorv43VLFvZl TQZDiSwiFnM4KJ2cxKoRpCUPlROo135akE/MY4wqmV1m+8R5lOrrvySw0OtrKx18VQPJ r72TwU61sd0UK6eZ9IZYiK44knQHHDnT8jvn6A9eYDMQy0GAae4p51kvBGs6lJRYX9zu JFMM2OpPZh7ML5EVWOK6T39C/TecunQbonxAG/NikRj/F2seD1nwLOJhzcRPLacHqfj7 c8zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tEC9knj0; 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 v10si17158865plo.388.2021.04.26.00.36.50; Mon, 26 Apr 2021 00:36:51 -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=tEC9knj0; 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 S232887AbhDZHh2 (ORCPT + 12 others); Mon, 26 Apr 2021 03:37:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:49266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232930AbhDZHgm (ORCPT ); Mon, 26 Apr 2021 03:36:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6977613BE; Mon, 26 Apr 2021 07:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422478; bh=uAAUyMljlcrTr7L/lCee6dkkMCsypVanYPJhHqDkpug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tEC9knj04Ppo7wknyXeK1i43JT21dtoxo3OZtDoQub1JL+IWN/uYOxDSU1lJY7eQu mgSiEcDxFmgkifeFdG5hWQXOf3mWa1I4259myF+rqwFfXr58b3olDFEkKuP+iTIcDY tcQ/GO242VistzX3M6zt/RS4mlh8CamEFqf9oYoo= 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 4.14 07/49] ARM: keystone: fix integer overflow warning Date: Mon, 26 Apr 2021 09:29:03 +0200 Message-Id: <20210426072819.961786212@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072819.721586742@linuxfoundation.org> References: <20210426072819.721586742@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 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; }