Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit afffd55f98ffeb4bb6cb0a7d58a6e0928dd9bac5 Author: Marek Lindner lindner_marek@yahoo.de Date: Sun Aug 5 18:10:45 2012 +0200
batman-adv: separate BATADV_ATTR_HIF_UINT sysfs name from hard-iface variable
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
afffd55f98ffeb4bb6cb0a7d58a6e0928dd9bac5 sysfs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/sysfs.c b/sysfs.c index 66518c7..fa6c8b1 100644 --- a/sysfs.c +++ b/sysfs.c @@ -122,7 +122,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ batadv_store_##_name)
-#define BATADV_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func) \ +#define BATADV_ATTR_HIF_STORE_UINT(_name, _var, _min, _max, _post_func) \ ssize_t batadv_store_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff, \ size_t count) \ @@ -137,13 +137,13 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \ \ length = __batadv_store_uint_attr(buff, count, _min, _max, \ _post_func, attr, \ - &hard_iface->_name, net_dev); \ + &hard_iface->_var, net_dev); \ \ batadv_hardif_free_ref(hard_iface); \ return length; \ }
-#define BATADV_ATTR_HIF_SHOW_UINT(_name) \ +#define BATADV_ATTR_HIF_SHOW_UINT(_name, _var) \ ssize_t batadv_show_##_name(struct kobject *kobj, \ struct attribute *attr, char *buff) \ { \ @@ -155,7 +155,7 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ if (!hard_iface) \ return 0; \ \ - length = sprintf(buff, "%i\n", atomic_read(&hard_iface->_name));\ + length = sprintf(buff, "%i\n", atomic_read(&hard_iface->_var)); \ \ batadv_hardif_free_ref(hard_iface); \ return length; \ @@ -164,9 +164,10 @@ ssize_t batadv_show_##_name(struct kobject *kobj, \ /* Use this, if you are going to set [name] in hard_iface to an * unsigned integer value */ -#define BATADV_ATTR_HIF_UINT(_name, _mode, _min, _max, _post_func) \ - static BATADV_ATTR_HIF_STORE_UINT(_name, _min, _max, _post_func)\ - static BATADV_ATTR_HIF_SHOW_UINT(_name) \ +#define BATADV_ATTR_HIF_UINT(_name, _var, _mode, _min, _max, _post_func)\ + static BATADV_ATTR_HIF_STORE_UINT(_name, _var, _min, \ + _max, _post_func) \ + static BATADV_ATTR_HIF_SHOW_UINT(_name, _var) \ static BATADV_ATTR(_name, _mode, batadv_show_##_name, \ batadv_store_##_name)