* [PATCH] nvme: make some sysfs diagnostic structures static
@ 2026-06-10 8:53 John Garry
2026-06-10 9:11 ` Nilay Shroff
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: John Garry @ 2026-06-10 8:53 UTC (permalink / raw)
To: hch, kbusch, sagi, axboe; +Cc: linux-nvme, nilay, John Garry
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.
Signed-off-by: John Garry <john.g.garry@oracle.com>
diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 933a5adfb7af5..75b2d69b59578 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -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);
--
2.43.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme: make some sysfs diagnostic structures static
2026-06-10 8:53 [PATCH] nvme: make some sysfs diagnostic structures static John Garry
@ 2026-06-10 9:11 ` Nilay Shroff
2026-06-10 9:28 ` John Garry
2026-06-10 11:57 ` Christoph Hellwig
2026-06-10 14:31 ` Keith Busch
2 siblings, 1 reply; 5+ messages in thread
From: Nilay Shroff @ 2026-06-10 9:11 UTC (permalink / raw)
To: John Garry, hch, kbusch, sagi, axboe; +Cc: linux-nvme
On 6/10/26 2:23 PM, John Garry wrote:
> 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.
>
> Signed-off-by: John Garry <john.g.garry@oracle.com>
>
> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
> index 933a5adfb7af5..75b2d69b59578 100644
> --- a/drivers/nvme/host/sysfs.c
> +++ b/drivers/nvme/host/sysfs.c
> @@ -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);
>
BTW, kernel test robot also reported this same issue here:
https://lore.kernel.org/oe-kbuild-all/202606101329.T3zXNqdy-lkp@intel.com/
So you may want to add closes tag pointing to the above link. Otherwise,
this change looks good to me.
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme: make some sysfs diagnostic structures static
2026-06-10 9:11 ` Nilay Shroff
@ 2026-06-10 9:28 ` John Garry
0 siblings, 0 replies; 5+ messages in thread
From: John Garry @ 2026-06-10 9:28 UTC (permalink / raw)
To: Nilay Shroff, hch, kbusch, sagi, axboe; +Cc: linux-nvme
>> }
>> -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);
> BTW, kernel test robot also reported this same issue here:
> https://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-
> all/202606101329.T3zXNqdy-lkp@intel.com/__;!!ACWV5N9M2RV99hQ!
> P5UdkxQBbB6XuNloxfIJKNALsPKk8vSXQENG4khm-
> SufSw1QG_Ndga5ZvcKhtCypHWJDcNkaE1KDvZZ8pO8$
> So you may want to add closes tag pointing to the above link. Otherwise,
> this change looks good to me.
>
I would not have noticed that, but here is the necessary tag anyway:
Closes:
https://lore.kernel.org/oe-kbuild-all/202606101329.T3zXNqdy-lkp@intel.com/
> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme: make some sysfs diagnostic structures static
2026-06-10 8:53 [PATCH] nvme: make some sysfs diagnostic structures static John Garry
2026-06-10 9:11 ` Nilay Shroff
@ 2026-06-10 11:57 ` Christoph Hellwig
2026-06-10 14:31 ` Keith Busch
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-06-10 11:57 UTC (permalink / raw)
To: John Garry; +Cc: hch, kbusch, sagi, axboe, linux-nvme, nilay
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvme: make some sysfs diagnostic structures static
2026-06-10 8:53 [PATCH] nvme: make some sysfs diagnostic structures static John Garry
2026-06-10 9:11 ` Nilay Shroff
2026-06-10 11:57 ` Christoph Hellwig
@ 2026-06-10 14:31 ` Keith Busch
2 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2026-06-10 14:31 UTC (permalink / raw)
To: John Garry; +Cc: hch, sagi, axboe, linux-nvme, nilay
On Wed, Jun 10, 2026 at 08:53:32AM +0000, John Garry wrote:
> 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.
Thanks, applied to nvme-7.2.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-10 14:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 8:53 [PATCH] nvme: make some sysfs diagnostic structures static John Garry
2026-06-10 9:11 ` Nilay Shroff
2026-06-10 9:28 ` John Garry
2026-06-10 11:57 ` Christoph Hellwig
2026-06-10 14:31 ` Keith Busch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.