diff options
author | Eliad Peller <eliad@wizery.com> | 2014-12-29 01:24:02 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-09 08:47:51 -0500 |
commit | 16129d1d59be0f330f80b33fef8a7a7d7b18394d (patch) | |
tree | 9f2caa7c2195740ccd3752a1103d3287a4b8cbb9 /drivers/net/wireless/ti | |
parent | d6b984816b902c73b2273c6088f52660a54c2034 (diff) |
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: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/debugfs.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c index 0be21f62fcb0..68f3bf229b5a 100644 --- a/drivers/net/wireless/ti/wlcore/debugfs.c +++ b/drivers/net/wireless/ti/wlcore/debugfs.c | |||
@@ -929,17 +929,10 @@ static ssize_t beacon_filtering_write(struct file *file, | |||
929 | { | 929 | { |
930 | struct wl1271 *wl = file->private_data; | 930 | struct wl1271 *wl = file->private_data; |
931 | struct wl12xx_vif *wlvif; | 931 | struct wl12xx_vif *wlvif; |
932 | char buf[10]; | ||
933 | size_t len; | ||
934 | unsigned long value; | 932 | unsigned long value; |
935 | int ret; | 933 | int ret; |
936 | 934 | ||
937 | len = min(count, sizeof(buf) - 1); | 935 | ret = kstrtoul_from_user(user_buf, count, 0, &value); |
938 | if (copy_from_user(buf, user_buf, len)) | ||
939 | return -EFAULT; | ||
940 | buf[len] = '\0'; | ||
941 | |||
942 | ret = kstrtoul(buf, 0, &value); | ||
943 | if (ret < 0) { | 936 | if (ret < 0) { |
944 | wl1271_warning("illegal value for beacon_filtering!"); | 937 | wl1271_warning("illegal value for beacon_filtering!"); |
945 | return -EINVAL; | 938 | return -EINVAL; |