[Intel-gfx] [PATCH] drm/i915: throw __must_check at GEM_WARN_ON

Chris Wilson chris at chris-wilson.co.uk
Fri Apr 6 11:39:01 UTC 2018


Quoting Joonas Lahtinen (2018-04-06 12:29:01)
> Quoting Matthew Auld (2018-04-04 14:19:04)
> > GEM_WARN_ON is intended to be used as:
> > 
> > if (GEM_WARN_ON(expr))
> >         ...
> > 
> > However this isn't clear since we just wrap WARN_ON, therefore throw a
> > warning if the result is ignored. For !DRM_I915_DEBUG_GEM builds this
> > should already be the case.
> > 
> > Suggested-by: Jani Nikula <jani.nikula at linux.intel.com>
> > Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> 
> I think this would be a worthwhile improvement.

At the very least may I beg for the GEM_TRACE output and #expr?
#expr kind of defeats the use of an inline... Or at least requires more
macro magic.
-Chris


More information about the Intel-gfx mailing list