[PATCH 0/2] Define generic helpers for manipulating macro arguments

Michal Wajdeczko michal.wajdeczko at intel.com
Thu May 2 09:24:36 UTC 2024



On 02.05.2024 09:24, Andy Shevchenko wrote:
> On Thu, May 02, 2024 at 12:32:19AM +0200, Michal Wajdeczko wrote:
>> Michal Wajdeczko (2):
>>   args.h: add more helpers for manipulating macro arguments
>>   drm/xe/rtp: Prefer helper macros from args.h
>>
>>  drivers/gpu/drm/xe/xe_rtp.h         |   4 +-
>>  drivers/gpu/drm/xe/xe_rtp_helpers.h |  26 +++----
>>  include/linux/args.h                | 103 ++++++++++++++++++++++++++++
>>  3 files changed, 115 insertions(+), 18 deletions(-)
> 
> It's good in general to have the code being deduplicated, but the above
> statistics is a bit scary. 

The statistics here might be little blurred due to added documentation.
Without documentation this would look a little better:

 drivers/gpu/drm/xe/xe_rtp.h         |  4 ++--
 drivers/gpu/drm/xe/xe_rtp_helpers.h | 26 ++++++++++----------------
 include/linux/args.h                | 26 ++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 18 deletions(-)

> Do we have more users where we indeed make code much
> nicer? 

A new user (still inside Xe driver) for these macro is on it's way, but
before that I wanted to start with a preparation step and promote any
generic helpers to the outside of the Xe driver, as it was pointed in
similar case with other helper macro [1]

[1] https://patchwork.freedesktop.org/patch/578134/?series=129854&rev=1

> If not, let's keep these where it belongs to for now.
> 

If this proposal didn't get any traction, which won't surprise me based
on outcome of [2], then at least I would have some ground for creating a
local xe_args.h or use xe_macros.h as a location for common args macros.

[2]
https://lore.kernel.org/lkml/20240214214654.1700-1-michal.wajdeczko@intel.com/


More information about the Intel-xe mailing list