Commit 669b258a authored by Lianjie Zhang's avatar Lianjie Zhang Committed by David S. Miller

bonding: helper macro __ATTR_RO to make code more clear

Signed-off-by: default avatarLianjie Zhang <zhanglianjie@uniontech.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83b7b77a
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment