mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] constify hid attribute_group structures.
@ 2017-08-03 11:26 Arvind Yadav
  2017-08-03 11:26 ` [PATCH 1/4] HID: multitouch: constify " Arvind Yadav
  2017-08-03 11:41 ` [PATCH 0/4] constify hid " Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-08-03 11:26 UTC (permalink / raw)
  To: jikos, benjamin.tissoires; +Cc: linux-kernel, linux-input

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.

Arvind Yadav (5):
  [PATCH 1/4] HID: multitouch: constify attribute_group structures.
  [PATCH 2/4] HID: sensor: constify attribute_group structures.
  [PATCH 3/4] HID: logitech-hidpp: constify attribute_group structures.
  [PATCH 4/4] HID: ntrig: constify attribute_group structures.

 drivers/hid/hid-logitech-hidpp.c |  2 +-
 drivers/hid/hid-multitouch.c     |  2 +-
 drivers/hid/hid-ntrig.c          |  2 +-
 drivers/hid/hid-sensor-custom.c  |  2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/4] HID: multitouch: constify attribute_group structures.
  2017-08-03 11:26 [PATCH 0/4] constify hid attribute_group structures Arvind Yadav
@ 2017-08-03 11:26 ` Arvind Yadav
  2017-08-03 11:41 ` [PATCH 0/4] constify hid " Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-08-03 11:26 UTC (permalink / raw)
  To: jikos, benjamin.tissoires; +Cc: linux-kernel, linux-input

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/hid/hid-multitouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f3e35e7..58285bc 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -341,7 +341,7 @@ static ssize_t mt_set_quirks(struct device *dev,
 	NULL
 };
 
-static struct attribute_group mt_attribute_group = {
+static const struct attribute_group mt_attribute_group = {
 	.attrs = sysfs_attrs
 };
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/4] constify hid attribute_group structures.
  2017-08-03 11:26 [PATCH 0/4] constify hid attribute_group structures Arvind Yadav
  2017-08-03 11:26 ` [PATCH 1/4] HID: multitouch: constify " Arvind Yadav
@ 2017-08-03 11:41 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2017-08-03 11:41 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: benjamin.tissoires, linux-kernel, linux-input

On Thu, 3 Aug 2017, 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.
> 
> Arvind Yadav (5):
>   [PATCH 1/4] HID: multitouch: constify attribute_group structures.
>   [PATCH 2/4] HID: sensor: constify attribute_group structures.
>   [PATCH 3/4] HID: logitech-hidpp: constify attribute_group structures.
>   [PATCH 4/4] HID: ntrig: constify attribute_group structures.
> 
>  drivers/hid/hid-logitech-hidpp.c |  2 +-
>  drivers/hid/hid-multitouch.c     |  2 +-
>  drivers/hid/hid-ntrig.c          |  2 +-
>  drivers/hid/hid-sensor-custom.c  |  2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

I've applied this to for-4.14/constify-attribute_group branch, but please 
fix your workflow for any furture submissions -- the series wasn't 
properly threaded, only patch 1/4 got threaded to 0/4 mail, others were 
missing References/In-reply-to header completely.

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-03 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 11:26 [PATCH 0/4] constify hid attribute_group structures Arvind Yadav
2017-08-03 11:26 ` [PATCH 1/4] HID: multitouch: constify " Arvind Yadav
2017-08-03 11:41 ` [PATCH 0/4] constify hid " Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®