]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme: use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE for multipath_sysfs
authorJohn Garry <john.g.garry@oracle.com>
Wed, 13 May 2026 09:50:30 +0000 (09:50 +0000)
committerKeith Busch <kbusch@kernel.org>
Wed, 27 May 2026 15:01:36 +0000 (08:01 -0700)
Use DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE instead of
DEFINE_SYSFS_GROUP_VISIBLE, which means that we can drop
multipath_sysfs_attr_visible().

Incidentally, multipath_sysfs_attr_visible() should have returned a
umode_t.

This idea was suggested by Ben Marzinski elsewhere.

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 b682c1a4b23f9e71eab10d27e5f147ba22c9373d..1f471f2cfd2519e9edfe6e2de475abaeb6b8903c 100644 (file)
@@ -335,14 +335,7 @@ static bool multipath_sysfs_group_visible(struct kobject *kobj)
 
        return nvme_disk_is_ns_head(dev_to_disk(dev));
 }
-
-static bool multipath_sysfs_attr_visible(struct kobject *kobj,
-               struct attribute *attr, int n)
-{
-       return false;
-}
-
-DEFINE_SYSFS_GROUP_VISIBLE(multipath_sysfs)
+DEFINE_SIMPLE_SYSFS_GROUP_VISIBLE(multipath_sysfs)
 
 const struct attribute_group nvme_ns_mpath_attr_group = {
        .name           = "multipath",