From: Andi Shyti <andi.shyti@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@gmail.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gmch: avoid unused variable warning
Date: Mon, 12 Jun 2023 15:35:42 +0200 [thread overview]
Message-ID: <20230612133542.knm4edwlk2nhfboj@intel.intel> (raw)
In-Reply-To: <20230612124408.521325-1-arnd@kernel.org>
Hi Arnd,
On Mon, Jun 12, 2023 at 02:43:59PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_PNP is disabled, the mchbar_addr variable is only written but
> not read:
>
> drivers/gpu/drm/i915/soc/intel_gmch.c: In function 'intel_alloc_mchbar_resource':
> drivers/gpu/drm/i915/soc/intel_gmch.c:41:13: error: variable 'mchbar_addr' set but not used [-Werror=unused-but-set-variable]
> 41 | u64 mchbar_addr;
> | ^~~~~~~~~~~
>
> No idea why this showed up now, but it's easy to fix by changing the #ifdef to
> an IS_ENABLED() check that the compiler can see through.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Andi
> ---
> I saw this last week already, so it's likely that someone else already sent
> a fix for it.
>
> drivers/gpu/drm/i915/soc/intel_gmch.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
> index 6d0204942f7a5..49c7fb16e934f 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.c
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
> @@ -47,11 +47,9 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915)
> mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
>
> /* If ACPI doesn't have it, assume we need to allocate it ourselves */
> -#ifdef CONFIG_PNP
> - if (mchbar_addr &&
> + if (IS_ENABLED(CONFIG_PNP) && mchbar_addr &&
> pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
> return 0;
> -#endif
>
> /* Get some space for it */
> i915->gmch.mch_res.name = "i915 MCHBAR";
> --
> 2.39.2
>
next prev parent reply other threads:[~2023-06-12 13:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 12:43 [Intel-gfx] [PATCH] drm/i915/gmch: avoid unused variable warning Arnd Bergmann
2023-06-12 13:35 ` Andi Shyti [this message]
2023-06-12 13:53 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2023-06-12 14:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-12 21:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-06-12 23:03 ` [Intel-gfx] [PATCH] " Andi Shyti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230612133542.knm4edwlk2nhfboj@intel.intel \
--to=andi.shyti@kernel.org \
--cc=airlied@gmail.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox