Commit 16129d1d authored by Eliad Peller's avatar Eliad Peller Committed by Kalle Valo

wlcore: fix sparse warning

Use kstrtoul_from_user() for reading the user value,
and fix the following sparse warning:

drivers/net/wireless/ti/wlcore/debugfs.c:937:15: error: incompatible
types in comparison expression (different type sizes)
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent d6b98481
...@@ -929,17 +929,10 @@ static ssize_t beacon_filtering_write(struct file *file, ...@@ -929,17 +929,10 @@ static ssize_t beacon_filtering_write(struct file *file,
{ {
struct wl1271 *wl = file->private_data; struct wl1271 *wl = file->private_data;
struct wl12xx_vif *wlvif; struct wl12xx_vif *wlvif;
char buf[10];
size_t len;
unsigned long value; unsigned long value;
int ret; int ret;
len = min(count, sizeof(buf) - 1); ret = kstrtoul_from_user(user_buf, count, 0, &value);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;
buf[len] = '\0';
ret = kstrtoul(buf, 0, &value);
if (ret < 0) { if (ret < 0) {
wl1271_warning("illegal value for beacon_filtering!"); wl1271_warning("illegal value for beacon_filtering!");
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment