Skip to content

Commit 3c4e919

Browse files
rikardfalkebornjgunthorpe
authored andcommitted
RDMA/rtrs: Constify static struct attribute_group
The only usage of these is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which takes const pointers. Make it const to allow the compiler to put them in read-only memory. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 42d5179 commit 3c4e919

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static struct attribute *rtrs_clt_stats_attrs[] = {
312312
NULL
313313
};
314314

315-
static struct attribute_group rtrs_clt_stats_attr_group = {
315+
static const struct attribute_group rtrs_clt_stats_attr_group = {
316316
.attrs = rtrs_clt_stats_attrs,
317317
};
318318

@@ -388,7 +388,7 @@ static struct attribute *rtrs_clt_sess_attrs[] = {
388388
NULL,
389389
};
390390

391-
static struct attribute_group rtrs_clt_sess_attr_group = {
391+
static const struct attribute_group rtrs_clt_sess_attr_group = {
392392
.attrs = rtrs_clt_sess_attrs,
393393
};
394394

@@ -460,7 +460,7 @@ static struct attribute *rtrs_clt_attrs[] = {
460460
NULL,
461461
};
462462

463-
static struct attribute_group rtrs_clt_attr_group = {
463+
static const struct attribute_group rtrs_clt_attr_group = {
464464
.attrs = rtrs_clt_attrs,
465465
};
466466

drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static struct attribute *rtrs_srv_sess_attrs[] = {
135135
NULL,
136136
};
137137

138-
static struct attribute_group rtrs_srv_sess_attr_group = {
138+
static const struct attribute_group rtrs_srv_sess_attr_group = {
139139
.attrs = rtrs_srv_sess_attrs,
140140
};
141141

@@ -148,7 +148,7 @@ static struct attribute *rtrs_srv_stats_attrs[] = {
148148
NULL,
149149
};
150150

151-
static struct attribute_group rtrs_srv_stats_attr_group = {
151+
static const struct attribute_group rtrs_srv_stats_attr_group = {
152152
.attrs = rtrs_srv_stats_attrs,
153153
};
154154

0 commit comments

Comments
 (0)