Driver core: bin_attribute parameters can often be const*
Many struct bin_attribute descriptors are purely read-only structures, and there's no need to change them. Therefore make the promise not to, which will let those descriptors be put in a ro section. Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
26579ab70a
commit
66ecb92be9
@@ -319,13 +319,13 @@ struct device_attribute {
|
||||
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
|
||||
|
||||
extern int __must_check device_create_file(struct device *device,
|
||||
const struct device_attribute *entry);
|
||||
const struct device_attribute *entry);
|
||||
extern void device_remove_file(struct device *dev,
|
||||
const struct device_attribute *attr);
|
||||
extern int __must_check device_create_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
const struct bin_attribute *attr);
|
||||
extern void device_remove_bin_file(struct device *dev,
|
||||
struct bin_attribute *attr);
|
||||
const struct bin_attribute *attr);
|
||||
extern int device_schedule_callback_owner(struct device *dev,
|
||||
void (*func)(struct device *dev), struct module *owner);
|
||||
|
||||
|
@@ -99,8 +99,9 @@ int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
|
||||
void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
|
||||
|
||||
int __must_check sysfs_create_bin_file(struct kobject *kobj,
|
||||
struct bin_attribute *attr);
|
||||
void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
|
||||
const struct bin_attribute *attr);
|
||||
void sysfs_remove_bin_file(struct kobject *kobj,
|
||||
const struct bin_attribute *attr);
|
||||
|
||||
int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target,
|
||||
const char *name);
|
||||
@@ -175,13 +176,13 @@ static inline void sysfs_remove_file(struct kobject *kobj,
|
||||
}
|
||||
|
||||
static inline int sysfs_create_bin_file(struct kobject *kobj,
|
||||
struct bin_attribute *attr)
|
||||
const struct bin_attribute *attr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void sysfs_remove_bin_file(struct kobject *kobj,
|
||||
struct bin_attribute *attr)
|
||||
const struct bin_attribute *attr)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user