Skip to content

Commit

Permalink
RDMA/rtrs: Constify static struct attribute_group
Browse files Browse the repository at this point in the history
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/20200930224004.24279-3-rikard.falkeborn@gmail.com
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Rikard Falkeborn authored and Jason Gunthorpe committed Oct 1, 2020
1 parent 42d5179 commit 3c4e919
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static struct attribute *rtrs_clt_stats_attrs[] = {
NULL
};

static struct attribute_group rtrs_clt_stats_attr_group = {
static const struct attribute_group rtrs_clt_stats_attr_group = {
.attrs = rtrs_clt_stats_attrs,
};

Expand Down Expand Up @@ -388,7 +388,7 @@ static struct attribute *rtrs_clt_sess_attrs[] = {
NULL,
};

static struct attribute_group rtrs_clt_sess_attr_group = {
static const struct attribute_group rtrs_clt_sess_attr_group = {
.attrs = rtrs_clt_sess_attrs,
};

Expand Down Expand Up @@ -460,7 +460,7 @@ static struct attribute *rtrs_clt_attrs[] = {
NULL,
};

static struct attribute_group rtrs_clt_attr_group = {
static const struct attribute_group rtrs_clt_attr_group = {
.attrs = rtrs_clt_attrs,
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static struct attribute *rtrs_srv_sess_attrs[] = {
NULL,
};

static struct attribute_group rtrs_srv_sess_attr_group = {
static const struct attribute_group rtrs_srv_sess_attr_group = {
.attrs = rtrs_srv_sess_attrs,
};

Expand All @@ -148,7 +148,7 @@ static struct attribute *rtrs_srv_stats_attrs[] = {
NULL,
};

static struct attribute_group rtrs_srv_stats_attr_group = {
static const struct attribute_group rtrs_srv_stats_attr_group = {
.attrs = rtrs_srv_stats_attrs,
};

Expand Down

0 comments on commit 3c4e919

Please sign in to comment.