lkml.org 
[lkml]   [2017]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: unisys: visorbus: constify attribute_group structures.
On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote:
> Hi Greg,
>
>
> On Monday 17 July 2017 04:15 PM, Greg KH wrote:
> > On Mon, Jul 17, 2017 at 02:55:37PM +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>
> > > ---
> > > drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> > > drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
> > > 2 files changed, 3 insertions(+), 3 deletions(-)
> > Why not just use the ATTRIBUTE_GROUPS() macro for these? Or is there
> > something that is preventing that?
> Yes, we can use. if we are only initializing '.attrs'.
> ATTRIBUTE_GROUPS() will not work if we will initialize other member of
> attribute_group like 'bin_attrs', 'is_visible', and 'name'.

That means you should redo this patch :)

Also, your changelog text had a typo, it is "attribute_group", not
"attribute_groups".

thanks,

greg k-h

\
 
 \ /
  Last update: 2017-07-17 14:38    [W:0.046 / U:0.160 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site