]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
drm/i915/pmu: Hide the (unsigned long)ptr cast
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Nov 2017 21:17:51 +0000 (21:17 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 24 Nov 2017 08:54:02 +0000 (08:54 +0000)
commitb7d3aabf900728b6b13b860157026fd26099208a
tree70faa955d1864e572fe26d03ed1d79c4ca2f52f4
parent8911a31c813275882fdc15554235a914e678759e
drm/i915/pmu: Hide the (unsigned long)ptr cast

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@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171123211751.2885-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_pmu.c