Skip to content

Commit bf1ad6c

Browse files
t-8chgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/20250114-sysfs-const-bin_attr-devcoredump-v1-1-fa93be30efae@weissschuh.net Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e3a89cc commit bf1ad6c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/base/devcoredump.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,8 @@ static ssize_t devcd_data_write(struct file *filp, struct kobject *kobj,
132132
return count;
133133
}
134134

135-
static struct bin_attribute devcd_attr_data = {
136-
.attr = { .name = "data", .mode = S_IRUSR | S_IWUSR, },
137-
.size = 0,
138-
.read = devcd_data_read,
139-
.write = devcd_data_write,
140-
};
135+
static struct bin_attribute devcd_attr_data =
136+
__BIN_ATTR(data, 0600, devcd_data_read, devcd_data_write, 0);
141137

142138
static struct bin_attribute *devcd_dev_bin_attrs[] = {
143139
&devcd_attr_data, NULL,

0 commit comments

Comments
 (0)