]> git.hungrycats.org Git - linux/commitdiff
driver core: Constify attribute arguments of binary attributes
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 3 Nov 2024 17:03:39 +0000 (17:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Nov 2024 13:00:28 +0000 (14:00 +0100)
As preparation for the constification of struct bin_attribute,
constify the arguments of the read and write callbacks.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Krzysztof Wilczyński <kw@linux.com>
Link: https://lore.kernel.org/r/20241103-sysfs-const-bin_attr-v2-10-71110628844c@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/node.c
drivers/base/topology.c

index eb72580288e62727e5b2198a6451cf9c2533225a..3e761633ac75826bedb5dd30b879f7cc1af95ec3 100644 (file)
@@ -27,7 +27,7 @@ static const struct bus_type node_subsys = {
 };
 
 static inline ssize_t cpumap_read(struct file *file, struct kobject *kobj,
-                                 struct bin_attribute *attr, char *buf,
+                                 const struct bin_attribute *attr, char *buf,
                                  loff_t off, size_t count)
 {
        struct device *dev = kobj_to_dev(kobj);
@@ -48,7 +48,7 @@ static inline ssize_t cpumap_read(struct file *file, struct kobject *kobj,
 static BIN_ATTR_RO(cpumap, CPUMAP_FILE_MAX_BYTES);
 
 static inline ssize_t cpulist_read(struct file *file, struct kobject *kobj,
-                                  struct bin_attribute *attr, char *buf,
+                                  const struct bin_attribute *attr, char *buf,
                                   loff_t off, size_t count)
 {
        struct device *dev = kobj_to_dev(kobj);
index 89f98be5c5b9915b2974e184bf89c4c25c183095..1090751d7f458ce8d2a50e82d65b8ce31e938f15 100644 (file)
@@ -23,7 +23,7 @@ static ssize_t name##_show(struct device *dev,                                \
 
 #define define_siblings_read_func(name, mask)                                  \
 static ssize_t name##_read(struct file *file, struct kobject *kobj,            \
-                          struct bin_attribute *attr, char *buf,               \
+                          const struct bin_attribute *attr, char *buf,         \
                           loff_t off, size_t count)                            \
 {                                                                              \
        struct device *dev = kobj_to_dev(kobj);                                 \
@@ -33,7 +33,7 @@ static ssize_t name##_read(struct file *file, struct kobject *kobj,           \
 }                                                                              \
                                                                                \
 static ssize_t name##_list_read(struct file *file, struct kobject *kobj,       \
-                               struct bin_attribute *attr, char *buf,          \
+                               const struct bin_attribute *attr, char *buf,    \
                                loff_t off, size_t count)                       \
 {                                                                              \
        struct device *dev = kobj_to_dev(kobj);                                 \