Commit 19eccc2b authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller

kstrtox: convert drivers/isdn/

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dffc6b24
...@@ -390,12 +390,12 @@ static const struct zsau_resp_t { ...@@ -390,12 +390,12 @@ static const struct zsau_resp_t {
*/ */
static int cid_of_response(char *s) static int cid_of_response(char *s)
{ {
unsigned long cid; int cid;
int rc; int rc;
if (s[-1] != ';') if (s[-1] != ';')
return 0; /* no CID separator */ return 0; /* no CID separator */
rc = strict_strtoul(s, 10, &cid); rc = kstrtoint(s, 10, &cid);
if (rc) if (rc)
return 0; /* CID not numeric */ return 0; /* CID not numeric */
if (cid < 1 || cid > 65535) if (cid < 1 || cid > 65535)
...@@ -566,27 +566,19 @@ void gigaset_handle_modem_response(struct cardstate *cs) ...@@ -566,27 +566,19 @@ void gigaset_handle_modem_response(struct cardstate *cs)
case RT_ZCAU: case RT_ZCAU:
event->parameter = -1; event->parameter = -1;
if (curarg + 1 < params) { if (curarg + 1 < params) {
unsigned long type, value; u8 type, value;
i = strict_strtoul(argv[curarg++], 16, &type);
j = strict_strtoul(argv[curarg++], 16, &value);
if (i == 0 && type < 256 && i = kstrtou8(argv[curarg++], 16, &type);
j == 0 && value < 256) j = kstrtou8(argv[curarg++], 16, &value);
if (i == 0 && j == 0)
event->parameter = (type << 8) | value; event->parameter = (type << 8) | value;
} else } else
curarg = params - 1; curarg = params - 1;
break; break;
case RT_NUMBER: case RT_NUMBER:
event->parameter = -1; if (curarg >= params ||
if (curarg < params) { kstrtoint(argv[curarg++], 10, &event->parameter))
unsigned long res; event->parameter = -1;
int rc;
rc = strict_strtoul(argv[curarg++], 10, &res);
if (rc == 0)
event->parameter = res;
}
gig_dbg(DEBUG_EVENT, "parameter==%d", event->parameter); gig_dbg(DEBUG_EVENT, "parameter==%d", event->parameter);
break; break;
} }
......
...@@ -155,7 +155,6 @@ put_log_buffer(hysdn_card * card, char *cp) ...@@ -155,7 +155,6 @@ put_log_buffer(hysdn_card * card, char *cp)
static ssize_t static ssize_t
hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off) hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
{ {
unsigned long u = 0;
int rc; int rc;
unsigned char valbuf[128]; unsigned char valbuf[128];
hysdn_card *card = file->private_data; hysdn_card *card = file->private_data;
...@@ -167,12 +166,10 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t ...@@ -167,12 +166,10 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t
valbuf[count] = 0; /* terminating 0 */ valbuf[count] = 0; /* terminating 0 */
rc = strict_strtoul(valbuf, 0, &u); rc = kstrtoul(valbuf, 0, &card->debug_flags);
if (rc < 0)
if (rc == 0) { return rc;
card->debug_flags = u; /* remember debug flags */ hysdn_addlog(card, "debug set to 0x%lx", card->debug_flags);
hysdn_addlog(card, "debug set to 0x%lx", card->debug_flags);
}
return (count); return (count);
} /* hysdn_log_write */ } /* hysdn_log_write */
......
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