aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_sysfs.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-05-14 17:14:50 -0400
committerSven Eckelmann <sven@narfation.org>2011-05-30 01:39:31 -0400
commit747e4221a03cde62402b614ca1f8e961b8416130 (patch)
tree98428064fef191a5093e276d5a779b9e801a97f0 /net/batman-adv/bat_sysfs.c
parent38e3c5f0dae7a3bbb32c3b2bb28c3f2557d40fe9 (diff)
batman-adv: Add const type qualifier for pointers
batman-adv uses pointers which are marked as const and should not violate that type qualifier by passing it to functions which force a cast to the non-const version. Signed-off-by: Sven Eckelmann <sven@narfation.org>
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);