* [PATCH] drm/i915/gmch: fix build error var set but not used
@ 2023-08-10 13:56 ` Wang Jinchao
0 siblings, 0 replies; 6+ messages in thread
From: Wang Jinchao @ 2023-08-10 13:56 UTC (permalink / raw)
To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
Cc: stone.xulei
When CONFIG_PNP is not defined, i915 will fail to compile with error bellow:
drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used
Fix it by surrounding variable declaration and assignment with ifdef
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
drivers/gpu/drm/i915/soc/intel_gmch.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
index 6d0204942f7a..d2c442b0b4eb 100644
--- a/drivers/gpu/drm/i915/soc/intel_gmch.c
+++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
@@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915)
{
int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915;
u32 temp_lo, temp_hi = 0;
- u64 mchbar_addr;
int ret;
-
+#ifdef CONFIG_PNP
+ u64 mchbar_addr;
+#endif
if (GRAPHICS_VER(i915) >= 4)
pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi);
pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo);
- mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
/* If ACPI doesn't have it, assume we need to allocate it ourselves */
#ifdef CONFIG_PNP
+ mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
if (mchbar_addr &&
pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
return 0;
--
2.40.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] drm/i915/gmch: fix build error var set but not used
@ 2023-08-10 13:56 ` Wang Jinchao
0 siblings, 0 replies; 6+ messages in thread
From: Wang Jinchao @ 2023-08-10 13:56 UTC (permalink / raw)
To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
Cc: stone.xulei
When CONFIG_PNP is not defined, i915 will fail to compile with error bellow:
drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used
Fix it by surrounding variable declaration and assignment with ifdef
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
drivers/gpu/drm/i915/soc/intel_gmch.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
index 6d0204942f7a..d2c442b0b4eb 100644
--- a/drivers/gpu/drm/i915/soc/intel_gmch.c
+++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
@@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915)
{
int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915;
u32 temp_lo, temp_hi = 0;
- u64 mchbar_addr;
int ret;
-
+#ifdef CONFIG_PNP
+ u64 mchbar_addr;
+#endif
if (GRAPHICS_VER(i915) >= 4)
pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi);
pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo);
- mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
/* If ACPI doesn't have it, assume we need to allocate it ourselves */
#ifdef CONFIG_PNP
+ mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
if (mchbar_addr &&
pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
return 0;
--
2.40.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [Intel-gfx] [PATCH] drm/i915/gmch: fix build error var set but not used
2023-08-10 13:56 ` Wang Jinchao
@ 2023-08-10 14:12 ` Jani Nikula
-1 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2023-08-10 14:12 UTC (permalink / raw)
To: Wang Jinchao, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
Cc: stone.xulei
On Thu, 10 Aug 2023, Wang Jinchao <wangjinchao@xfusion.com> wrote:
> When CONFIG_PNP is not defined, i915 will fail to compile with error bellow:
> drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used
> Fix it by surrounding variable declaration and assignment with ifdef
>
> Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Thanks for the patch, but this was fixed a couple of months ago by
commit b02a9a0c6cb3 ("drm/i915/gmch: avoid unused variable warning").
Please check the development trees or linux-next before sending fixes.
Thanks,
Jani.
> ---
> drivers/gpu/drm/i915/soc/intel_gmch.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
> index 6d0204942f7a..d2c442b0b4eb 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.c
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
> @@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915)
> {
> int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915;
> u32 temp_lo, temp_hi = 0;
> - u64 mchbar_addr;
> int ret;
> -
> +#ifdef CONFIG_PNP
> + u64 mchbar_addr;
> +#endif
> if (GRAPHICS_VER(i915) >= 4)
> pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi);
> pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo);
> - mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
>
> /* If ACPI doesn't have it, assume we need to allocate it ourselves */
> #ifdef CONFIG_PNP
> + mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
> if (mchbar_addr &&
> pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
> return 0;
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] drm/i915/gmch: fix build error var set but not used
@ 2023-08-10 14:12 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2023-08-10 14:12 UTC (permalink / raw)
To: Wang Jinchao, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, intel-gfx, dri-devel, linux-kernel
Cc: stone.xulei
On Thu, 10 Aug 2023, Wang Jinchao <wangjinchao@xfusion.com> wrote:
> When CONFIG_PNP is not defined, i915 will fail to compile with error bellow:
> drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used
> Fix it by surrounding variable declaration and assignment with ifdef
>
> Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Thanks for the patch, but this was fixed a couple of months ago by
commit b02a9a0c6cb3 ("drm/i915/gmch: avoid unused variable warning").
Please check the development trees or linux-next before sending fixes.
Thanks,
Jani.
> ---
> drivers/gpu/drm/i915/soc/intel_gmch.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c
> index 6d0204942f7a..d2c442b0b4eb 100644
> --- a/drivers/gpu/drm/i915/soc/intel_gmch.c
> +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c
> @@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915)
> {
> int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915;
> u32 temp_lo, temp_hi = 0;
> - u64 mchbar_addr;
> int ret;
> -
> +#ifdef CONFIG_PNP
> + u64 mchbar_addr;
> +#endif
> if (GRAPHICS_VER(i915) >= 4)
> pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi);
> pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo);
> - mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
>
> /* If ACPI doesn't have it, assume we need to allocate it ourselves */
> #ifdef CONFIG_PNP
> + mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
> if (mchbar_addr &&
> pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
> return 0;
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/gmch: fix build error var set but not used
2023-08-10 13:56 ` Wang Jinchao
` (2 preceding siblings ...)
(?)
@ 2023-08-14 14:04 ` Patchwork
-1 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2023-08-14 14:04 UTC (permalink / raw)
To: Wang Jinchao; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gmch: fix build error var set but not used
URL : https://patchwork.freedesktop.org/series/122416/
State : failure
== Summary ==
Error: patch https://patchwork.freedesktop.org/api/1.0/series/122416/revisions/1/mbox/ not applied
Applying: drm/i915/gmch: fix build error var set but not used
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/soc/intel_gmch.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/soc/intel_gmch.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/soc/intel_gmch.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 drm/i915/gmch: fix build error var set but not used
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Build failed, no error log produced
^ permalink raw reply [flat|nested] 6+ messages in thread