* [PATCH v2] staging: unisys: visorbus: Constify attribute_group structures.
@ 2017-07-18 5:24 Arvind Yadav
2017-07-18 6:50 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-07-18 5:24 UTC (permalink / raw)
To: david.kershner, gregkh, Timothy.Sell, bryan.thompson, jon.frisch,
david.binder, sparmaintainer
Cc: devel, linux-kernel
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>
---
Changes in v2:
Change log typo was not correct.
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 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,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,
};
@@ -340,7 +340,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 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] staging: unisys: visorbus: Constify attribute_group structures.
2017-07-18 5:24 [PATCH v2] staging: unisys: visorbus: Constify attribute_group structures Arvind Yadav
@ 2017-07-18 6:50 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2017-07-18 6:50 UTC (permalink / raw)
To: Arvind Yadav
Cc: david.kershner, Timothy.Sell, bryan.thompson, jon.frisch,
david.binder, sparmaintainer, devel, linux-kernel
On Tue, Jul 18, 2017 at 10:54:21AM +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>
> ---
> Changes in v2:
> Change log typo was not correct.
>
> drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> drivers/staging/unisys/visorbus/visorchipset.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
Does not apply to my tree at all anymore, probably due to other visorbus
patches I just took :(
Please rebase and resend.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-18 6:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 5:24 [PATCH v2] staging: unisys: visorbus: Constify attribute_group structures Arvind Yadav
2017-07-18 6:50 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome