diff options
| -rw-r--r-- | driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch | 53 | ||||
| -rw-r--r-- | series | 2 |
2 files changed, 54 insertions, 1 deletions
diff --git a/driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch b/driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch new file mode 100644 index 00000000000000..0b19bb90bb3c0d --- /dev/null +++ b/driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch @@ -0,0 +1,53 @@ +From khali@linux-fr.org Wed Jul 7 14:40:00 2010 +From: Jean Delvare <khali@linux-fr.org> +Date: Fri, 2 Jul 2010 16:54:05 +0200 +Subject: sysfs: sysfs_chmod_file's attr can be const +Cc: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <20100702165405.0a903769@hyperion.delvare> + + +sysfs_chmod_file doesn't change the attribute it operates on, so this +attribute can be marked const. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + fs/sysfs/file.c | 3 ++- + include/linux/sysfs.h | 6 +++--- + 2 files changed, 5 insertions(+), 4 deletions(-) + +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -593,7 +593,8 @@ EXPORT_SYMBOL_GPL(sysfs_add_file_to_grou + * @mode: file permissions. + * + */ +-int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) ++int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, ++ mode_t mode) + { + struct sysfs_dirent *sd; + struct iattr newattrs; +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -136,8 +136,8 @@ int __must_check sysfs_create_file(struc + const struct attribute *attr); + int __must_check sysfs_create_files(struct kobject *kobj, + const struct attribute **attr); +-int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, +- mode_t mode); ++int __must_check sysfs_chmod_file(struct kobject *kobj, ++ const struct attribute *attr, mode_t mode); + void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); + void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); + +@@ -225,7 +225,7 @@ static inline int sysfs_create_files(str + } + + static inline int sysfs_chmod_file(struct kobject *kobj, +- struct attribute *attr, mode_t mode) ++ const struct attribute *attr, mode_t mode) + { + return 0; + } @@ -40,6 +40,7 @@ driver-core/driver-core-use-kmemdup-in-platform_device_add_resources.patch driver-core/driver-core-reduce-duplicated-code-for-platform_device-creation.patch driver-core/driver-core-move-platform-device-creation-helpers-to-.init.text-if-module-n.patch driver-core/firmware-update-hotplug-script-remove-sysfs-files.patch +driver-core/sysfs-sysfs_chmod_file-s-attr-can-be-const.patch ##################################### # TTY patches for after 2.6.35 is out @@ -151,4 +152,3 @@ usb/usb-gadget-g_fs-code-cleanup.patch # staging stuff is now in the staging-next tree on git.kernel.org - |
