Skip to content

Commit

Permalink
bonding: helper macro __ATTR_RO to make code more clear
Browse files Browse the repository at this point in the history
Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lianjie Zhang authored and David S. Miller committed Mar 6, 2022
1 parent 83b7b77 commit 669b258
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/bonding/bond_sysfs_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 669b258

Please sign in to comment.