Message ID | 1351423037-5292-4-git-send-email-ordex@autistici.org |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Antonio Quartulli <ordex@autistici.org> Date: Sun, 28 Oct 2012 12:17:04 +0100 > From: Marek Lindner <lindner_marek@yahoo.de> > > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> > Signed-off-by: Antonio Quartulli <ordex@autistici.org> > --- > net/batman-adv/sysfs.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) I was wondering how you could possibly change the list of arguments to these macros, yet avoid changing any of the users. And sure enough it's because these macros are completely unused. Please just remove them instead of changing their interfaces when no users exist. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello David, On Sun, Oct 28, 2012 at 06:59:27PM -0400, David Miller wrote: > From: Antonio Quartulli <ordex@autistici.org> > Date: Sun, 28 Oct 2012 12:17:04 +0100 > > > From: Marek Lindner <lindner_marek@yahoo.de> > > > > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> > > Signed-off-by: Antonio Quartulli <ordex@autistici.org> > > --- > > net/batman-adv/sysfs.c | 15 ++++++++------- > > 1 file changed, 8 insertions(+), 7 deletions(-) > > I was wondering how you could possibly change the list of arguments to > these macros, yet avoid changing any of the users. > > And sure enough it's because these macros are completely unused. when this macro was introduced a user was going to be added as well, but then we delayed some work and the user was not introduced anymore.. > > Please just remove them instead of changing their interfaces when no > users exist. Yes, I will resend the pull request with a patch that removes this macro at all. We will re-introduce it as soon as the user is ready too. Cheers,
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c index 66518c7..fa6c8b1 100644 --- a/net/batman-adv/sysfs.c +++ b/net/batman-adv/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)