diff mbox series

[v3,8/9] drivers/perf: Simpilfy EVENT ATTR macro in arm_dsu_pmu.c

Message ID 1623123201-45634-9-git-send-email-liuqi115@huawei.com (mailing list archive)
State New, archived
Headers show
Series drivers/perf: Use general macro to simplify event attributes | expand

Commit Message

liuqi (BA) June 8, 2021, 3:33 a.m. UTC
Use common macro PMU_EVENT_ATTR_ID to simplify DSU_EVENT_ATTR.

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm_dsu_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Will Deacon June 8, 2021, 8:52 a.m. UTC | #1
On Tue, Jun 08, 2021 at 11:33:20AM +0800, Qi Liu wrote:
> Use common macro PMU_EVENT_ATTR_ID to simplify DSU_EVENT_ATTR.
> 
> Cc: Will Deacon <will@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Qi Liu <liuqi115@huawei.com>
> ---
>  drivers/perf/arm_dsu_pmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
> index 196faea..bed8376 100644
> --- a/drivers/perf/arm_dsu_pmu.c
> +++ b/drivers/perf/arm_dsu_pmu.c
> @@ -82,7 +82,7 @@
>  	})[0].attr.attr)
>  
>  #define DSU_EVENT_ATTR(_name, _config)		\
> -	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_event_show, (unsigned long)_config)
> +	PMU_EVENT_ATTR_ID(_name, dsu_pmu_sysfs_event_show, _config)
>  
>  #define DSU_FORMAT_ATTR(_name, _config)		\
>  	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_format_show, (char *)_config)

I'm not convinced this is any simpler. We still have two users of the
DSU_EXT_ATTR macro and the net effect is no change in line count.

Will
liuqi (BA) June 9, 2021, 1:26 a.m. UTC | #2
Hi Will,
On 2021/6/8 16:52, Will Deacon wrote:
> On Tue, Jun 08, 2021 at 11:33:20AM +0800, Qi Liu wrote:
>> Use common macro PMU_EVENT_ATTR_ID to simplify DSU_EVENT_ATTR.
>>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Signed-off-by: Qi Liu <liuqi115@huawei.com>
>> ---
>>   drivers/perf/arm_dsu_pmu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
>> index 196faea..bed8376 100644
>> --- a/drivers/perf/arm_dsu_pmu.c
>> +++ b/drivers/perf/arm_dsu_pmu.c
>> @@ -82,7 +82,7 @@
>>   	})[0].attr.attr)
>>   
>>   #define DSU_EVENT_ATTR(_name, _config)		\
>> -	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_event_show, (unsigned long)_config)
>> +	PMU_EVENT_ATTR_ID(_name, dsu_pmu_sysfs_event_show, _config)
>>   
>>   #define DSU_FORMAT_ATTR(_name, _config)		\
>>   	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_format_show, (char *)_config)
> 
> I'm not convinced this is any simpler. We still have two users of the
> DSU_EXT_ATTR macro and the net effect is no change in line count.
> 
Got it, I'll drop this patch and sent a new patchset.

Thanks,
Qi
> Will
> .
>
diff mbox series

Patch

diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
index 196faea..bed8376 100644
--- a/drivers/perf/arm_dsu_pmu.c
+++ b/drivers/perf/arm_dsu_pmu.c
@@ -82,7 +82,7 @@ 
 	})[0].attr.attr)
 
 #define DSU_EVENT_ATTR(_name, _config)		\
-	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_event_show, (unsigned long)_config)
+	PMU_EVENT_ATTR_ID(_name, dsu_pmu_sysfs_event_show, _config)
 
 #define DSU_FORMAT_ATTR(_name, _config)		\
 	DSU_EXT_ATTR(_name, dsu_pmu_sysfs_format_show, (char *)_config)