diff options
author | Lianjie Zhang <zhanglianjie@uniontech.com> | 2022-03-06 16:28:08 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-06 12:10:16 +0000 |
commit | 669b258a793db9f1c3bff29ce2bbd61b810503ad (patch) | |
tree | 01f679058cd768a2552a5f7d571f844fb7edf386 /drivers/net/bonding | |
parent | 83b7b77af37a89a1ef82201ac8fb45456ecc25bb (diff) | |
download | linux-stable-669b258a793db9f1c3bff29ce2bbd61b810503ad.tar.gz linux-stable-669b258a793db9f1c3bff29ce2bbd61b810503ad.tar.bz2 linux-stable-669b258a793db9f1c3bff29ce2bbd61b810503ad.zip |
bonding: helper macro __ATTR_RO to make code more clear
Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_sysfs_slave.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 6a6cdd0bb258..69b0a3751dff 100644 --- 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) { |