summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-01-14 22:44:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-15 18:30:57 +0100
commitbf1ad6c869fdf972ecd80097214aa3223ccd457c (patch)
tree72ce6fcdbe4dd8ff256320a93e4ee79cfb0056d0
parente3a89cc281b60fbd39fa6c1509e80001b77fd8c1 (diff)
devcoredump: Define 'struct bin_attribute' through macro
The macro saves some lines of code and simplifies the constification of the attribute. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20250114-sysfs-const-bin_attr-devcoredump-v1-1-fa93be30efae@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/devcoredump.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
index 2a0e0b2fdb98..4b1f7a6cee52 100644
--- a/drivers/base/devcoredump.c
+++ b/drivers/base/devcoredump.c
@@ -132,12 +132,8 @@ static ssize_t devcd_data_write(struct file *filp, struct kobject *kobj,
return count;
}
-static struct bin_attribute devcd_attr_data = {
- .attr = { .name = "data", .mode = S_IRUSR | S_IWUSR, },
- .size = 0,
- .read = devcd_data_read,
- .write = devcd_data_write,
-};
+static struct bin_attribute devcd_attr_data =
+ __BIN_ATTR(data, 0600, devcd_data_read, devcd_data_write, 0);
static struct bin_attribute *devcd_dev_bin_attrs[] = {
&devcd_attr_data, NULL,