drm/i915: Fix typecheck macro in GT_TRACE
diff mbox series

Message ID 20191216185332.83289-1-venkata.s.dhanalakota@intel.com
State New
Headers show
Series
  • drm/i915: Fix typecheck macro in GT_TRACE
Related show

Commit Message

Venkata Sandeep Dhanalakota Dec. 16, 2019, 6:53 p.m. UTC
typecheck() macro creates an huge stack size causing
issues with static analysis with coverity, addressing
this with creating a local pointer.

Fixes: 639f2f24895f ("drm/i915: Introduce new macros for tracing")
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Chris Wilson Dec. 16, 2019, 9:03 p.m. UTC | #1
Quoting Venkata Sandeep Dhanalakota (2019-12-16 18:53:32)
> typecheck() macro creates an huge stack size causing
> issues with static analysis with coverity, addressing
> this with creating a local pointer.
> 
> Fixes: 639f2f24895f ("drm/i915: Introduce new macros for tracing")
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_gt.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
> index 9d9e8831daeb..2355cf129e9c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.h
> @@ -12,9 +12,9 @@
>  
>  struct drm_i915_private;
>  
> -#define GT_TRACE(gt__, fmt, ...) do {                                  \
> -       typecheck(struct intel_gt, *(gt__));                            \
> -       GEM_TRACE("%s  " fmt, dev_name(gt->i915->drm.dev),              \
> +#define GT_TRACE(gt, fmt, ...) do {                                    \
> +       const struct intel_gt *gt__ __maybe_unused = (gt);              \
> +       GEM_TRACE("%s  " fmt, dev_name(gt__->i915->drm.dev),            \
>                   ##__VA_ARGS__);                                       \
>  } while (0)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.h b/drivers/gpu/drm/i915/gt/intel_gt.h
index 9d9e8831daeb..2355cf129e9c 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt.h
@@ -12,9 +12,9 @@ 
 
 struct drm_i915_private;
 
-#define GT_TRACE(gt__, fmt, ...) do {					\
-	typecheck(struct intel_gt, *(gt__));				\
-	GEM_TRACE("%s  " fmt, dev_name(gt->i915->drm.dev),		\
+#define GT_TRACE(gt, fmt, ...) do {					\
+	const struct intel_gt *gt__ __maybe_unused = (gt);		\
+	GEM_TRACE("%s  " fmt, dev_name(gt__->i915->drm.dev),		\
 		  ##__VA_ARGS__);					\
 } while (0)