Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3903176pxb; Mon, 27 Sep 2021 05:22:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFUkv5s7YgmNR0aBU0WOzw7HJUiwE1O7/oFqlOD8yagOqDLxPtTV929fy9iLnYidMduQ3Y X-Received: by 2002:a17:90b:b13:: with SMTP id bf19mr12403095pjb.168.1632745338298; Mon, 27 Sep 2021 05:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632745338; cv=none; d=google.com; s=arc-20160816; b=ViMnDKBe2QTl8wuJ+UHKU4hWJzZ6jD3VxdZAOgXDmFTt3aMn81qoPYM/QH/eCKQAZp Nc1FlO+sPZHvfkeBQ3E4ZMMhrErXoB2lNAR8UF53zKARp28sTE7y2+4QbkM3TXzMSmSP t7YFHzrD3+uh68FwJq6YzQ1DthJPmhmBpH9Aw6YzyJvWoBX/zeC7G+BzxKxlj96WIY8M m7ui8Voz8jqQU5LnEEVlq0zj/5eaNNu1hZPWq4WQtg/aRrKh4a+jOHJfN3iDRqd38C6d RkgDE5ikATmEkI+/3dyL1dujt8vs85UDqpN8nDG+MbOcrr5cV8VPxy7q78VbMtRDmTpI Mo+A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=VJsp7wXArGshscLC47ggBUmDDP9I3znybjGb0IBbryw=; b=PpoyDJhagZS+ucFC9L4GhRmF4ZWHH4pD4vmHJvHL1XYxqvY8NA9Cg4mv0C938Mpdhm ygJMLXTSXDp2LHWy1CPwwUoRQA2TX2GH6oo37M6wRlYpXaATx8EWuvg47qHrUSCbM/rd I80YXMqE3RtnNw7OVOtKometn4KVzUQ2rxXozv1gZuXxUbFRVHjdQqzd+Hsfy/JmlRN6 GrR6FD4rnOgDXFZeKgTHSrBVZAB7uvPLMqhZeGx33yNBsDyxeS1xFk5Qrkm8l994ZEFR IyBrGd53QUCjiACPAKCjFaG70VcVXEyhwtGxq5TeDDcA1OtGbPJsSadgrjUAd1g81sDJ fiTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a4PnTyc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si19935055pgj.173.2021.09.27.05.22.04; Mon, 27 Sep 2021 05:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=a4PnTyc+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234241AbhI0MVm (ORCPT + 99 others); Mon, 27 Sep 2021 08:21:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbhI0MVl (ORCPT ); Mon, 27 Sep 2021 08:21:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87C0161058; Mon, 27 Sep 2021 12:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632745203; bh=rmYi1PvPT1PYGiIrRbsoqUqXMv2Mf8xdCMrtisP77f8=; h=From:To:Cc:Subject:Date:From; b=a4PnTyc+sw14XVzQYouRB33jI9JBDcpSCFSVPIqcMZAwh1kPwxjMkMl1VbpWmWFCQ ZIPPJyRMw//6bUf9KtqQ92XXzx9ECuMO/kM/Ty70tUAr1mf5FB3zhyQtpJ6ky57GfP pF6pF80dgXOHevWXfr1K8HKNRJxA6Xf1w7rQWKzCoeqk1luwGAMkqhQJQD2Loxf4ER Y9wrOFVDEKUlOs7r7e8/ENkwttHv7HOenm5LVFfmZFQbPVHz7ArAupgisbxwu5eyl1 voL6Xbs/QWhoYLuXQAJOjyQcAjCq4RwhJ+ZoVthtUgUMpDMwZJbGeYgqhYN26Zklpi 3LnFhuX4T1xPg== From: Arnd Bergmann To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Evan Quan , Hawking Zhang , Huang Rui , shaoyunl , Andrey Grodzovsky , Jack Zhang , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] drm/amdgpu: fix clang out-of-range warning Date: Mon, 27 Sep 2021 14:19:45 +0200 Message-Id: <20210927121958.941637-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann clang-14 points out that comparing an 'unsigned int' against a large 64-bit constantn is pointless: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1206:18: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] res->start > 0x100000000ull) Rephrase the comparison using the upper_32_bits() macro, which should keep it legible while avoiding the warning. Fixes: 31b8adab3247 ("drm/amdgpu: require a root bus window above 4GB for BAR resize") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index ab3794c42d36..741a55031ca1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1203,7 +1203,7 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev) pci_bus_for_each_resource(root, res, i) { if (res && res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) && - res->start > 0x100000000ull) + upper_32_bits(res->start) != 0) break; } -- 2.29.2