Commit e94d91a6 authored by LABBE Corentin's avatar LABBE Corentin Committed by David S. Miller

atm: solos-pci: Replace simple_strtol by kstrtoint

The simple_strtol function is obsolete.
This patch replace it by kstrtoint.
This will simplify code, since some error case not handled by
simple_strtol are handled by kstrtoint.
Signed-off-by: default avatarLABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 857e8a67
...@@ -347,8 +347,8 @@ static char *next_string(struct sk_buff *skb) ...@@ -347,8 +347,8 @@ static char *next_string(struct sk_buff *skb)
*/ */
static int process_status(struct solos_card *card, int port, struct sk_buff *skb) static int process_status(struct solos_card *card, int port, struct sk_buff *skb)
{ {
char *str, *end, *state_str, *snr, *attn; char *str, *state_str, *snr, *attn;
int ver, rate_up, rate_down; int ver, rate_up, rate_down, err;
if (!card->atmdev[port]) if (!card->atmdev[port])
return -ENODEV; return -ENODEV;
...@@ -357,7 +357,11 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb ...@@ -357,7 +357,11 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
if (!str) if (!str)
return -EIO; return -EIO;
ver = simple_strtol(str, NULL, 10); err = kstrtoint(str, 10, &ver);
if (err) {
dev_warn(&card->dev->dev, "Unexpected status interrupt version\n");
return err;
}
if (ver < 1) { if (ver < 1) {
dev_warn(&card->dev->dev, "Unexpected status interrupt version %d\n", dev_warn(&card->dev->dev, "Unexpected status interrupt version %d\n",
ver); ver);
...@@ -373,16 +377,16 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb ...@@ -373,16 +377,16 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
return 0; return 0;
} }
rate_down = simple_strtol(str, &end, 10); err = kstrtoint(str, 10, &rate_down);
if (*end) if (err)
return -EIO; return err;
str = next_string(skb); str = next_string(skb);
if (!str) if (!str)
return -EIO; return -EIO;
rate_up = simple_strtol(str, &end, 10); err = kstrtoint(str, 10, &rate_up);
if (*end) if (err)
return -EIO; return err;
state_str = next_string(skb); state_str = next_string(skb);
if (!state_str) if (!state_str)
...@@ -417,7 +421,7 @@ static int process_command(struct solos_card *card, int port, struct sk_buff *sk ...@@ -417,7 +421,7 @@ static int process_command(struct solos_card *card, int port, struct sk_buff *sk
struct solos_param *prm; struct solos_param *prm;
unsigned long flags; unsigned long flags;
int cmdpid; int cmdpid;
int found = 0; int found = 0, err;
if (skb->len < 7) if (skb->len < 7)
return 0; return 0;
...@@ -428,7 +432,9 @@ static int process_command(struct solos_card *card, int port, struct sk_buff *sk ...@@ -428,7 +432,9 @@ static int process_command(struct solos_card *card, int port, struct sk_buff *sk
skb->data[6] != '\n') skb->data[6] != '\n')
return 0; return 0;
cmdpid = simple_strtol(&skb->data[1], NULL, 10); err = kstrtoint(&skb->data[1], 10, &cmdpid);
if (err)
return err;
spin_lock_irqsave(&card->param_queue_lock, flags); spin_lock_irqsave(&card->param_queue_lock, flags);
list_for_each_entry(prm, &card->param_queue, list) { list_for_each_entry(prm, &card->param_queue, list) {
......
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