From patchwork Mon Sep 27 12:19:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 514682 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp3882653ejj; Mon, 27 Sep 2021 05:20:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyZBliPxKFmAxmS++PcUpCuTHRndt0Mw0jaEcR7IrN9ZTBY3CUv1eSZLBEFW3m2/sPOBOY X-Received: by 2002:a62:7951:0:b0:447:eab3:1d16 with SMTP id u78-20020a627951000000b00447eab31d16mr23488521pfc.65.1632745211172; Mon, 27 Sep 2021 05:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632745211; cv=none; d=google.com; s=arc-20160816; b=aJJpTEr0DPlkUo7Oh7bOrfw7/Q40ImXhoZpWJo+ui8zN6CqA49f511aVEpyT+rixEP bWcc+5jugqNEagHqJJiKqQbbhD+nPMJ4yMY3EFNqvih8lWINxX96VUTjpJSlr34D8SOz N3rZ23kwMfc8Iv0BbaGxPVTAW2pfvXQY2OZRIKmBlSkx8eepkwPKLUOiiLgcL9SfS6ZG OAIlZ6qDFo+XB5+9Fp+Z47dCNicyJrwS56INRhFXmXbsj8hfAUgbQ6qGIuG4hbH/gNwn 7SIsZjKCreicxkf2xfpW7xaVttnyu0hzmaKewWWCWbUKQK+1TLCu9MgrVjOxnWuyG/IS BLSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :delivered-to; bh=VJsp7wXArGshscLC47ggBUmDDP9I3znybjGb0IBbryw=; b=htLsTWYJKXbE0822ZpO6tMU+E7G160rge8qot1kcbLjuEPx1moD0kvzxPOpwmGT+Vc Dyc+y2AHo0/mDdHtyMhzDvDogOh3lUsP2Uj18K5csqqy0X/9Y0meK4V5MdwjzjEewcEX TWX7cGdGr00yBOaxy2sBWtqGvanYJqn+V0tKkFkhAu+dOBHTsIphEjrBpf0SlAzWC2p1 ePeCtwY2Ih+IHs3V1YVqJtoDaWMU5ZA79K9DgPmyR5597NguZtTfiguqhBY1V958EbA4 ytFGoM5uJVMXUEueNVzK82Bg0jOmWQw8c+cgRITSsrsIJWQYN/6PZzH6x4XgrlfTF8OP urrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a4PnTyc+; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g187si1957438pfb.309.2021.09.27.05.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 05:20:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a4PnTyc+; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6278189F89; Mon, 27 Sep 2021 12:20:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id E487589F5B; Mon, 27 Sep 2021 12:20:03 +0000 (UTC) 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_K=C3=B6n?= =?utf-8?q?ig?= , "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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) -- 2.29.2 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; }