Re: [PATCH 2/2] cpufreq: use helper macro __ATTR_XX
From: Viresh Kumar
Date: Mon Mar 07 2022 - 00:44:40 EST
On 06-03-22, 10:12, zhanglianjie wrote:
> Use helper macro __ATTR_XX to make code more clear.
> Minor readability improvement.
>
> Signed-off-by: zhanglianjie <zhanglianjie@xxxxxxxxxxxxx>
>
> diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h
> index 65ecf32ba4f8..a5a0bc3cc23e 100644
> --- a/drivers/cpufreq/cpufreq_governor.h
> +++ b/drivers/cpufreq/cpufreq_governor.h
> @@ -68,12 +68,10 @@ static ssize_t file_name##_show \
> }
>
> #define gov_attr_ro(_name) \
> -static struct governor_attr _name = \
> -__ATTR(_name, 0444, _name##_show, NULL)
> +static struct governor_attr _name = __ATTR_RO(_name)
>
> #define gov_attr_rw(_name) \
> -static struct governor_attr _name = \
> -__ATTR(_name, 0644, _name##_show, _name##_store)
> +static struct governor_attr _name = __ATTR_RW(_name)
>
> /* Common to all CPUs of a policy */
> struct policy_dbs_info {
This change looks fine though.
--
viresh