]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme: make some sysfs diagnostic structures static
authorJohn Garry <john.g.garry@oracle.com>
Wed, 10 Jun 2026 08:53:32 +0000 (08:53 +0000)
committerKeith Busch <kbusch@kernel.org>
Wed, 10 Jun 2026 14:31:21 +0000 (07:31 -0700)
Building with C=1 generates the following warnings:
drivers/nvme/host/sysfs.c:397:25: warning: symbol 'dev_attr_io_errors' was not declared. Should it be static?
drivers/nvme/host/sysfs.c:444:30: warning: symbol 'nvme_ns_diag_attr_group' was not declared. Should it be static?
drivers/nvme/host/sysfs.c:1150:25: warning: symbol 'dev_attr_adm_errors' was not declared. Should it be static?

Make those structures static.

Closes: https://lore.kernel.org/oe-kbuild-all/202606101329.T3zXNqdy-lkp@intel.com/
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/sysfs.c

index 933a5adfb7af5d5974da480ecd6313ce9647b310..75b2d69b59578e3ff711e9aef8ed934e91168d65 100644 (file)
@@ -394,7 +394,7 @@ static ssize_t nvme_io_errors_store(struct device *dev,
        return count;
 }
 
-struct device_attribute dev_attr_io_errors =
+static struct device_attribute dev_attr_io_errors =
        __ATTR(command_error_count, 0644,
                nvme_io_errors_show, nvme_io_errors_store);
 
@@ -441,7 +441,7 @@ static umode_t nvme_ns_diag_attrs_are_visible(struct kobject *kobj,
        return a->mode;
 }
 
-const struct attribute_group nvme_ns_diag_attr_group = {
+static const struct attribute_group nvme_ns_diag_attr_group = {
        .name           = "diag",
        .attrs          = nvme_ns_diag_attrs,
        .is_visible     = nvme_ns_diag_attrs_are_visible,
@@ -1147,7 +1147,7 @@ static ssize_t nvme_adm_errors_store(struct device *dev,
        return count;
 }
 
-struct device_attribute dev_attr_adm_errors =
+static struct device_attribute dev_attr_adm_errors =
        __ATTR(command_error_count, 0644,
                nvme_adm_errors_show, nvme_adm_errors_store);