Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680888

Re: [PATCH] bus: arm-cci: constify attribute_group structures.

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] bus: arm-cci: constify attribute_group structures.
Date 2017-07-04 13:40 +0200
Message-ID <tZuls-7Dd-17@gated-at.bofh.it> (permalink)
References <tZ4hk-6qv-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jul 03, 2017 at 01:16:55PM +0530, Arvind Yadav wrote:
> attribute_groups are not supposed to change at runtime. All functions
> working with attribute_groups provided by <linux/sysfs.h> work with const
> attribute_group. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

From a quick scan, this looks sane to me:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Suzuki, Punit, I guess one of you will queue this, assuming you're happy
with it.

Mark.

> ---
>  drivers/bus/arm-cci.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
> index c49da15..64c75d2 100644
> --- a/drivers/bus/arm-cci.c
> +++ b/drivers/bus/arm-cci.c
> @@ -1445,16 +1445,16 @@ static ssize_t pmu_cpumask_attr_show(struct device *dev,
>  	NULL,
>  };
>  
> -static struct attribute_group pmu_attr_group = {
> +static const struct attribute_group pmu_attr_group = {
>  	.attrs = pmu_attrs,
>  };
>  
> -static struct attribute_group pmu_format_attr_group = {
> +static const struct attribute_group pmu_format_attr_group = {
>  	.name = "format",
>  	.attrs = NULL,		/* Filled in cci_pmu_init_attrs */
>  };
>  
> -static struct attribute_group pmu_event_attr_group = {
> +static const struct attribute_group pmu_event_attr_group = {
>  	.name = "events",
>  	.attrs = NULL,		/* Filled in cci_pmu_init_attrs */
>  };
> -- 
> 1.9.1
> 

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] bus: arm-cci: constify attribute_group structures. Mark Rutland <mark.rutland@arm.com> - 2017-07-04 13:40 +0200

csiph-web