Skip to content

Commit

Permalink
ath6kl: replace strict_strtoul() with kstrtoul()
Browse files Browse the repository at this point in the history
Recommended by checkpatch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Kalle Valo committed Mar 13, 2012
1 parent b0fc7c1 commit 06f33f1
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,17 +856,9 @@ static ssize_t ath6kl_regread_write(struct file *file,
size_t count, loff_t *ppos)
{
struct ath6kl *ar = file->private_data;
u8 buf[50];
unsigned int len;
unsigned long reg_addr;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';

if (strict_strtoul(buf, 0, &reg_addr))
if (kstrtoul_from_user(user_buf, count, 0, &reg_addr))
return -EINVAL;

if ((reg_addr % 4) != 0)
Expand Down Expand Up @@ -980,15 +972,8 @@ static ssize_t ath6kl_lrssi_roam_write(struct file *file,
{
struct ath6kl *ar = file->private_data;
unsigned long lrssi_roam_threshold;
char buf[32];
ssize_t len;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';
if (strict_strtoul(buf, 0, &lrssi_roam_threshold))
if (kstrtoul_from_user(user_buf, count, 0, &lrssi_roam_threshold))
return -EINVAL;

ar->lrssi_roam_threshold = lrssi_roam_threshold;
Expand Down

0 comments on commit 06f33f1

Please sign in to comment.