aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/bat_sysfs.c')
-rw-r--r--net/batman-adv/bat_sysfs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index 497a0700cc3c..6f70560ef508 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -96,7 +96,7 @@ ssize_t show_##_name(struct kobject *kobj, struct attribute *attr, \
96 96
97static int store_bool_attr(char *buff, size_t count, 97static int store_bool_attr(char *buff, size_t count,
98 struct net_device *net_dev, 98 struct net_device *net_dev,
99 char *attr_name, atomic_t *attr) 99 const char *attr_name, atomic_t *attr)
100{ 100{
101 int enabled = -1; 101 int enabled = -1;
102 102
@@ -138,16 +138,15 @@ static inline ssize_t __store_bool_attr(char *buff, size_t count,
138{ 138{
139 int ret; 139 int ret;
140 140
141 ret = store_bool_attr(buff, count, net_dev, (char *)attr->name, 141 ret = store_bool_attr(buff, count, net_dev, attr->name, attr_store);
142 attr_store);
143 if (post_func && ret) 142 if (post_func && ret)
144 post_func(net_dev); 143 post_func(net_dev);
145 144
146 return ret; 145 return ret;
147} 146}
148 147
149static int store_uint_attr(char *buff, size_t count, 148static int store_uint_attr(const char *buff, size_t count,
150 struct net_device *net_dev, char *attr_name, 149 struct net_device *net_dev, const char *attr_name,
151 unsigned int min, unsigned int max, atomic_t *attr) 150 unsigned int min, unsigned int max, atomic_t *attr)
152{ 151{
153 unsigned long uint_val; 152 unsigned long uint_val;
@@ -183,15 +182,15 @@ static int store_uint_attr(char *buff, size_t count,
183 return count; 182 return count;
184} 183}
185 184
186static inline ssize_t __store_uint_attr(char *buff, size_t count, 185static inline ssize_t __store_uint_attr(const char *buff, size_t count,
187 int min, int max, 186 int min, int max,
188 void (*post_func)(struct net_device *), 187 void (*post_func)(struct net_device *),
189 struct attribute *attr, 188 const struct attribute *attr,
190 atomic_t *attr_store, struct net_device *net_dev) 189 atomic_t *attr_store, struct net_device *net_dev)
191{ 190{
192 int ret; 191 int ret;
193 192
194 ret = store_uint_attr(buff, count, net_dev, (char *)attr->name, 193 ret = store_uint_attr(buff, count, net_dev, attr->name,
195 min, max, attr_store); 194 min, max, attr_store);
196 if (post_func && ret) 195 if (post_func && ret)
197 post_func(net_dev); 196 post_func(net_dev);