[Intel-gfx] [CI 1/2] drm/i915/uc: Ignore maybe-unused debug-only i915 local

Michal Wajdeczko michal.wajdeczko at intel.com
Thu Dec 12 10:46:44 UTC 2019


On Thu, 12 Dec 2019 08:27:36 +0100, Chris Wilson  
<chris at chris-wilson.co.uk> wrote:

> As the i915 local in __force_fw_fetch_failures() may not be used in a
> non-debug build, tell the compiler to ignore it and not throw waarning.

typo

>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c  
> b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> index b6aedee46f9e..4d02e06480e5 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> @@ -254,6 +254,8 @@ static void __force_fw_fetch_failures(struct  
> intel_uc_fw *uc_fw, int e)
>  		uc_fw->minor_ver_wanted = 0;
>  		uc_fw->user_overridden = true;
>  	}
> +
> +	(void)i915;

to avoid such mistakes in the future, I would rather fix inject macro:

diff --git a/drivers/gpu/drm/i915/i915_utils.h  
b/drivers/gpu/drm/i915/i915_utils.h
index 04139ba1191e..b0ade76bec90 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -69,7 +69,7 @@ bool i915_error_injected(void);

  #else

-#define i915_inject_probe_error(_i915, _err) 0
+#define i915_inject_probe_error(i915, e) ({ BUILD_BUG_ON_INVALID(i915);  
0; })
  #define i915_error_injected() false

  #endif


More information about the Intel-gfx mailing list