Skip to content

Commit 562e932

Browse files
t-8chgregkh
authored andcommitted
driver core: Constify attribute arguments of binary attributes
As preparation for the constification of struct bin_attribute, constify the arguments of the read and write callbacks. Signed-off-by: Thomas Weißschuh <[email protected]> Acked-by: Krzysztof Wilczyński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eb2e6c3 commit 562e932

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/base/node.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static const struct bus_type node_subsys = {
2727
};
2828

2929
static inline ssize_t cpumap_read(struct file *file, struct kobject *kobj,
30-
struct bin_attribute *attr, char *buf,
30+
const struct bin_attribute *attr, char *buf,
3131
loff_t off, size_t count)
3232
{
3333
struct device *dev = kobj_to_dev(kobj);
@@ -48,7 +48,7 @@ static inline ssize_t cpumap_read(struct file *file, struct kobject *kobj,
4848
static BIN_ATTR_RO(cpumap, CPUMAP_FILE_MAX_BYTES);
4949

5050
static inline ssize_t cpulist_read(struct file *file, struct kobject *kobj,
51-
struct bin_attribute *attr, char *buf,
51+
const struct bin_attribute *attr, char *buf,
5252
loff_t off, size_t count)
5353
{
5454
struct device *dev = kobj_to_dev(kobj);

drivers/base/topology.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static ssize_t name##_show(struct device *dev, \
2323

2424
#define define_siblings_read_func(name, mask) \
2525
static ssize_t name##_read(struct file *file, struct kobject *kobj, \
26-
struct bin_attribute *attr, char *buf, \
26+
const struct bin_attribute *attr, char *buf, \
2727
loff_t off, size_t count) \
2828
{ \
2929
struct device *dev = kobj_to_dev(kobj); \
@@ -33,7 +33,7 @@ static ssize_t name##_read(struct file *file, struct kobject *kobj, \
3333
} \
3434
\
3535
static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
36-
struct bin_attribute *attr, char *buf, \
36+
const struct bin_attribute *attr, char *buf, \
3737
loff_t off, size_t count) \
3838
{ \
3939
struct device *dev = kobj_to_dev(kobj); \

0 commit comments

Comments
 (0)