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


Groups > linux.kernel > #1689841 > unrolled thread

[PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-07-18 10:00 +0200
Last post2017-07-18 10:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-18 10:00 +0200
    Re: [PATCH v3] staging: unisys: visorbus: Constify attribute_group  structures. Greg KH <gregkh@linuxfoundation.org> - 2017-07-18 10:10 +0200
      Re: [PATCH v3] staging: unisys: visorbus: Constify attribute_group  structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-18 10:20 +0200

#1689841 — [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-18 10:00 +0200
Subject[PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.
Message-ID<u4vAd-81L-3@gated-at.bofh.it>
attribute_group are not supposed to change at runtime. All functions
working with attribute_group 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(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 9012cc1..ff80ab2 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -294,7 +294,7 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr,
 	NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
 	.name = "channel",
 	.attrs = channel_attrs,
 };
@@ -391,7 +391,7 @@ static ssize_t channel_id_show(struct device *dev,
 	NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
 	.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 87ea852..6d4498f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1138,7 +1138,7 @@ static ssize_t deviceenabled_store(struct device *dev,
 	NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
 	.name = "parahotplug",
 	.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

[toc] | [next] | [standalone]


#1689849 — Re: [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-07-18 10:10 +0200
SubjectRe: [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.
Message-ID<u4vJU-8k9-3@gated-at.bofh.it>
In reply to#1689841
On Tue, Jul 18, 2017 at 01:24:42PM +0530, Arvind Yadav wrote:
> attribute_group are not supposed to change at runtime. All functions
> working with attribute_group 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(-)

What changed from the previous patches?  Always include that below the
--- line as maintainers have no short-term memory at all.

v4?

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1689862 — Re: [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-18 10:20 +0200
SubjectRe: [PATCH v3] staging: unisys: visorbus: Constify attribute_group structures.
Message-ID<u4vTB-8ne-19@gated-at.bofh.it>
In reply to#1689849
Hi Greg,

On Tuesday 18 July 2017 01:30 PM, Greg KH wrote:
> On Tue, Jul 18, 2017 at 01:24:42PM +0530, Arvind Yadav wrote:
>> attribute_group are not supposed to change at runtime. All functions
>> working with attribute_group 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(-)
> What changed from the previous patches?  Always include that below the
> --- line as maintainers have no short-term memory at all.
>
> v4?
Sorry, I have missed it. :(
>
> thanks,
>
> greg k-h
~arvind

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web