[Intel-gfx] [PATCH v2] drm/i915/pmu: Hide the (unsigned long)ptr cast
Chris Wilson
chris at chris-wilson.co.uk
Fri Nov 24 09:35:50 UTC 2017
Quoting Tvrtko Ursulin (2017-11-24 08:42:06)
>
> On 23/11/2017 21:17, Chris Wilson wrote:
> > We pretend the PMU config id is a pointer value when encoding it into
> > the device parameters for presentation via sysfs. This requires casting
> > of an unsigned long into and out of the pointer member, which annoys
> > smatch:
> >
> > drivers/gpu/drm/i915/i915_pmu.c:684 i915_pmu_event_show() warn: argument 3 to %lx specifier is cast from pointer
> >
> > Instead of abusing a generic dev_ext_attribute, define our own typesafe
> > attributes.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
[snip]
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Thanks, it's such a trivial warning that I wasn't such if it was worth
the effort. But we are close to being smatch clean, and in the past it
has caught genuine bugs that gcc/sparse miss so I think it is a valuable
tool, and so worth the effort to get and stay clean.
-Chris
More information about the Intel-gfx
mailing list