From: Greg KH <greg@kroah.com>
To: "Kershner, David A" <David.Kershner@unisys.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>,
"Sell, Timothy C" <Timothy.Sell@unisys.com>,
"Thompson, Bryan E." <bryan.thompson@unisys.com>,
"jon.frisch@unisys.com" <jon.frisch@unisys.com>,
"Binder, David Anthony" <David.Binder@unisys.com>,
*S-Par-Maintainer <SParMaintainer@unisys.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.
Date: Tue, 18 Jul 2017 07:05:08 +0200 [thread overview]
Message-ID: <20170718050508.GE6176@kroah.com> (raw)
In-Reply-To: <CY4PR07MB31764083B4606C00677853A5F0A00@CY4PR07MB3176.namprd07.prod.outlook.com>
On Mon, Jul 17, 2017 at 09:36:58PM +0000, Kershner, David A wrote:
> > -----Original Message-----
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: Monday, July 17, 2017 8:38 AM
> > To: Arvind Yadav <arvind.yadav.cs@gmail.com>
> > Cc: Kershner, David A <David.Kershner@unisys.com>; Sell, Timothy C
> > <Timothy.Sell@unisys.com>; Thompson, Bryan E.
> > <bryan.thompson@unisys.com>; jon.frisch@unisys.com; Binder, David
> > Anthony <David.Binder@unisys.com>; *S-Par-Maintainer
> > <SParMaintainer@unisys.com>; devel@driverdev.osuosl.org; linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group
> > structures.
Why is this in your email body?
> >
> > 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".
> >
>
> Greg, are you recommending that we shouldn't be setting the attribute_group
> .name field? What does it pick up if we don't specify it?
Why do you want a name for your group? Anyway, yes, you are right, if
you set a .name, then you can't use the macro, my fault, I hadn't looked
at it in a long time.
> Also, for our attribute_groups in visorchipset, we are defining it with two
> different attribute_group variables. Are you allowed to use two different
> attribute_group variables in an attribute_groups, or is this frowned upon and
> we should flatten it out to just one? An example that we used in the kernel was:
>
> static const struct attribute_group *l2_cache_pmu_attr_grps[] = {
> &l2_cache_pmu_format_group,
> &l2_cache_pmu_cpumask_group,
> NULL,
> };
Nah, that's fine, sorry for the noise. But the changelog text still
should be fixed so I can take this.
thanks,
greg k-h
prev parent reply other threads:[~2017-07-18 5:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 9:25 [PATCH] staging: unisys: visorbus: constify attribute_group structures Arvind Yadav
2017-07-17 10:45 ` Greg KH
2017-07-17 12:13 ` Arvind Yadav
2017-07-17 12:37 ` Greg KH
2017-07-17 21:36 ` Kershner, David A
2017-07-18 5:05 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170718050508.GE6176@kroah.com \
--to=greg@kroah.com \
--cc=David.Binder@unisys.com \
--cc=David.Kershner@unisys.com \
--cc=SParMaintainer@unisys.com \
--cc=Timothy.Sell@unisys.com \
--cc=arvind.yadav.cs@gmail.com \
--cc=bryan.thompson@unisys.com \
--cc=devel@driverdev.osuosl.org \
--cc=jon.frisch@unisys.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox