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

bonding: helper macro __ATTR_RO to make code more clear

parent 83b7b77a
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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)
{