]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nvme: constify static attribute_group structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Fri, 8 Jan 2021 23:41:47 +0000 (00:41 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 2 Feb 2021 09:26:10 +0000 (10:26 +0100)
The only usage of these is to put their addresses in arrays of pointers
to const attribute_groups. Make them const to allow the compiler to put
them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/fc.c
drivers/nvme/target/fcloop.c

index ba5df80881ea98a1b85e6acd62a83fe2304195ae..ff0f42652abb4849660b0d870741faed5e427634 100644 (file)
@@ -2859,7 +2859,7 @@ static struct attribute *nvme_subsys_attrs[] = {
        NULL,
 };
 
-static struct attribute_group nvme_subsys_attrs_group = {
+static const struct attribute_group nvme_subsys_attrs_group = {
        .attrs = nvme_subsys_attrs,
 };
 
@@ -3694,7 +3694,7 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
        return a->mode;
 }
 
-static struct attribute_group nvme_dev_attrs_group = {
+static const struct attribute_group nvme_dev_attrs_group = {
        .attrs          = nvme_dev_attrs,
        .is_visible     = nvme_dev_attrs_are_visible,
 };
index 5f36cfa8136c0c81812fc7315994705678c45273..20dadd86e9812157cc655cc3ee0ab9eee9f6d423 100644 (file)
@@ -3789,7 +3789,7 @@ static struct attribute *nvme_fc_attrs[] = {
        NULL
 };
 
-static struct attribute_group nvme_fc_attr_group = {
+static const struct attribute_group nvme_fc_attr_group = {
        .attrs = nvme_fc_attrs,
 };
 
index 68213f0a052bbeb977a3df81785f86f35eed0056..54606f1872b4aba8aedbfbfa5ea5a9878e404b9d 100644 (file)
@@ -1545,7 +1545,7 @@ static struct attribute *fcloop_dev_attrs[] = {
        NULL
 };
 
-static struct attribute_group fclopp_dev_attrs_group = {
+static const struct attribute_group fclopp_dev_attrs_group = {
        .attrs          = fcloop_dev_attrs,
 };