]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/xe/gt_throttle: Tidy up attribute definition
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 29 Oct 2025 23:45:07 +0000 (16:45 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 31 Oct 2025 06:20:25 +0000 (23:20 -0700)
commit191db84b639a867f707fa5a64dff3d96a0aab7bc
tree33a746250f50d092a950948120f44ba787e98a6c
parenta5d0f605f1bb875de03abe3e12c0a614ecf3dc3d
drm/xe/gt_throttle: Tidy up attribute definition

Move the attribute definitions to be grouped together rather than near
the show() function: checkpatch keeps complaining about the missing
newline when defining new attributes and it reads better to group
everything, which should match e.g. the xe_pmu.c style.

While grouping them, also define a THROTTLE_ATTR_RO(), similar to
DEVICE_ATTR_RO(), and use it to define all attributes. This makes it
shorter and with a familiar syntax.

Finally, during the cri_throttle_attrs[] array definition, also
highlight what's coming from common attributes and what is CRI-specific.

These 3 things could be done as separate commits, but they are all about
the same thing: reduce the attribute definition verbosity and are very
simple and mechanical.

Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20251029-gt-throttle-cri-v3-5-d1f5abbb8114@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gt_throttle.c