projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83b7b77
)
bonding: helper macro __ATTR_RO to make code more clear
author
Lianjie Zhang
<zhanglianjie@uniontech.com>
Sun, 6 Mar 2022 08:28:08 +0000
(16:28 +0800)
committer
David S. Miller
<davem@davemloft.net>
Sun, 6 Mar 2022 12:10:16 +0000
(12:10 +0000)
Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_sysfs_slave.c
patch
|
blob
|
history
diff --git
a/drivers/net/bonding/bond_sysfs_slave.c
b/drivers/net/bonding/bond_sysfs_slave.c
index 6a6cdd0bb2585bd3f77d2cb590da9910f89f0337..69b0a3751dff4ba0d54d07fbf27f6910ef2bcc86 100644
(file)
--- a/
drivers/net/bonding/bond_sysfs_slave.c
+++ b/
drivers/net/bonding/bond_sysfs_slave.c
@@
-15,14
+15,8
@@
struct slave_attribute {
ssize_t (*show)(struct slave *, char *);
};
-#define SLAVE_ATTR(_name, _mode, _show) \
-const struct slave_attribute slave_attr_##_name = { \
- .attr = {.name = __stringify(_name), \
- .mode = _mode }, \
- .show = _show, \
-};
#define SLAVE_ATTR_RO(_name) \
-
SLAVE_ATTR(_name, 0444, _name##_show
)
+
const struct slave_attribute slave_attr_##_name = __ATTR_RO(_name
)
static ssize_t state_show(struct slave *slave, char *buf)
{