From patchwork Mon Apr 26 07:29:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 427515 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3458057jao; Mon, 26 Apr 2021 00:31:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo2pqHvimOnHngVUdOxvbSck9JVaUfsEgt2SPhCGzCIR/qqzCFJd8I8lS1rls75F3av4w6 X-Received: by 2002:a17:902:ea0e:b029:ec:7cd0:9106 with SMTP id s14-20020a170902ea0eb02900ec7cd09106mr17066434plg.9.1619422295864; Mon, 26 Apr 2021 00:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619422295; cv=none; d=google.com; s=arc-20160816; b=fb9Op+Lv1Olh/fGPZXhAPaltB6GEw2kjwGfqWtZ8YkgXOuR1o87hXvJdl7Wr9E3k4c shS51+63GW1L+5+8u8z9dRPwkCjsl0TYk5nFlj5rRj8G3c4sjKwiCk9LN+s3atfC+4aj kkr617vlzUJ4ufzc8rfuEWJHwGcwnv/gWEyatbRJdSY07oep74/Z0hmSN2ePQyzXdWK/ qBrRJWY+HE/SVu58Dti9ciAVfMAr7VMApSdVj68Q7iM5ZDdS0jFICr+RZU5fiE+UuxLu 8uD36vroWJ1x6AwYAgme1XJu/hpefWjNafWAaNKW1MLluR4uY0AFInK8mJ+qm+Ci0biz WOzw== 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=VEnSCmR2w/+gmRmre/9decQN8gAWlnAIe9gT2e2RXD4=; b=tDPJO6MvImZ5RwPW+zOYP3Jhw544YtiT788etnsnWSm1uAy529W9NbsdXhviHWvUEK QAWMEPzrgV+NUlaaOsi75ABdZu3yLkCSMQkA2WAyREeS1h4qcuLoN8tC4yq+UkdHSM7d 1hGFW359ZueKcPDEsIadOYfO4WPktswywtUHX8VgpSQlFnvRbHZJi+AUWInAIIDQOcyg 3Jxq76Ov3gY4o9EKne25bgrqRvbJAmBFm0Z75p8tKOBPZ9GJqV6yytHSpDX7PbOs6bFi B9+8hzRzH3WIk5SR/cz4lttzbT/F0cQjQ9NoMSkVeFDxbQ0u0u8e41hDUsbilxyZwPVn w7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DmLgkPn3; 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 j6si16531458pfb.110.2021.04.26.00.31.35; Mon, 26 Apr 2021 00:31:35 -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=DmLgkPn3; 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 S232348AbhDZHcP (ORCPT + 12 others); Mon, 26 Apr 2021 03:32:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:42880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbhDZHcN (ORCPT ); Mon, 26 Apr 2021 03:32:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ABFA2613C1; Mon, 26 Apr 2021 07:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422288; bh=Ew3eZz1A7AARzihvbY2139f+yYZ87nnlDO80F4sd2Sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DmLgkPn39KXiXQ/hIlLxmMXJQEp67nYQzNiobj8gSFf2V48WrnTxnatx1KHqFOlfb su+32RLz76uVOHCe7ou2qRt0nj40TTza4H1NgLyH9+tLcxqUTfHsDARYjXdUdBDsQt xtlecTLB+3Ngh6KsGydNPRW94OqgkPSV2/uMLyVQ= 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.4 07/32] ARM: keystone: fix integer overflow warning Date: Mon, 26 Apr 2021 09:29:05 +0200 Message-Id: <20210426072816.843441846@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072816.574319312@linuxfoundation.org> References: <20210426072816.574319312@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 c279293f084c..0f1f5c4141d5 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -71,7 +71,7 @@ static phys_addr_t keystone_virt_to_idmap(unsigned long x) 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(); @@ -84,7 +84,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; }