diff mbox series

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

Message ID 20191212072737.884335-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [CI,1/2] drm/i915/uc: Ignore maybe-unused debug-only i915 local | expand

Commit Message

Chris Wilson Dec. 12, 2019, 7:27 a.m. UTC
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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michal Wajdeczko Dec. 12, 2019, 10:46 a.m. UTC | #1
On Thu, 12 Dec 2019 08:27:36 +0100, Chris Wilson  
<chris@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@chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko@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
Chris Wilson Dec. 12, 2019, 10:48 a.m. UTC | #2
Quoting Michal Wajdeczko (2019-12-12 10:46:44)
> On Thu, 12 Dec 2019 08:27:36 +0100, Chris Wilson  
> <chris@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@chris-wilson.co.uk>
> > Cc: Michal Wajdeczko <michal.wajdeczko@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

Ok, send with my r-b!
-Chris
diff mbox series

Patch

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;
 }
 
 /**