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


Groups > linux.kernel > #1703914

[PATCH 04/11] usb: usbtmc: constify attribute_group structures.

From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 04/11] usb: usbtmc: constify attribute_group structures.
Date 2017-08-04 14:10 +0200
Message-ID <uaJAu-6MJ-43@gated-at.bofh.it> (permalink)
References <uaJAt-6MJ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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/usb/class/usbtmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 578f424..6ebfabf 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1085,7 +1085,7 @@ static DEVICE_ATTR_RO(name)
 	NULL,
 };
 
-static struct attribute_group capability_attr_grp = {
+static const struct attribute_group capability_attr_grp = {
 	.attrs = capability_attrs,
 };
 
@@ -1151,7 +1151,7 @@ static DEVICE_ATTR_RW(name)
 	NULL,
 };
 
-static struct attribute_group data_attr_grp = {
+static const struct attribute_group data_attr_grp = {
 	.attrs = data_attrs,
 };
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/11] constify usb attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 08/11] usb: phy-tahvo: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 11/11] usb: wusbcore: wusbhc: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 01/11] usb: atm: ueagle-atm: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 07/11] usb: phy-mv-usb: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 04/11] usb: usbtmc: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 10/11] usb: wusbcore: dev-sysfs: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 09/11] usb: wusbcore: cbaf: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 05/11] usb: hcd: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:10 +0200
  [PATCH 02/11] usb: chipidea: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-04 14:20 +0200

csiph-web