From: Thomas Weißschuh Date: Sun, 15 Dec 2024 14:49:11 +0000 (+0100) Subject: firmware: google: memconsole: Use const 'struct bin_attribute' callback X-Git-Tag: v6.14-rc1~169^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=093d752032f723da665cdaa6077ee62b3931e48b;p=thirdparty%2Flinux.git firmware: google: memconsole: Use const 'struct bin_attribute' callback The sysfs core now provides callback variants that explicitly take a const pointer. Use them so the non-const variants can be removed. Signed-off-by: Thomas Weißschuh Acked-by: Brian Norris Link: https://lore.kernel.org/r/20241215-sysfs-const-bin_attr-google-v1-3-e5c2808f5833@weissschuh.net Signed-off-by: Tzung-Bi Shih --- diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c index b9d99fe1ff0f6..d957af6f93498 100644 --- a/drivers/firmware/google/memconsole.c +++ b/drivers/firmware/google/memconsole.c @@ -14,7 +14,7 @@ #include "memconsole.h" static ssize_t memconsole_read(struct file *filp, struct kobject *kobp, - struct bin_attribute *bin_attr, char *buf, + const struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t count) { ssize_t (*memconsole_read_func)(char *, loff_t, size_t); @@ -28,7 +28,7 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp, static struct bin_attribute memconsole_bin_attr = { .attr = {.name = "log", .mode = 0444}, - .read = memconsole_read, + .read_new = memconsole_read, }; void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))