aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/ev-layer.c26
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c11
2 files changed, 13 insertions, 24 deletions
diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
index a14187605f5e..ba74646cf0e4 100644
--- a/drivers/isdn/gigaset/ev-layer.c
+++ b/drivers/isdn/gigaset/ev-layer.c
@@ -390,12 +390,12 @@ static const struct zsau_resp_t {
390 */ 390 */
391static int cid_of_response(char *s) 391static int cid_of_response(char *s)
392{ 392{
393 unsigned long cid; 393 int cid;
394 int rc; 394 int rc;
395 395
396 if (s[-1] != ';') 396 if (s[-1] != ';')
397 return 0; /* no CID separator */ 397 return 0; /* no CID separator */
398 rc = strict_strtoul(s, 10, &cid); 398 rc = kstrtoint(s, 10, &cid);
399 if (rc) 399 if (rc)
400 return 0; /* CID not numeric */ 400 return 0; /* CID not numeric */
401 if (cid < 1 || cid > 65535) 401 if (cid < 1 || cid > 65535)
@@ -566,27 +566,19 @@ void gigaset_handle_modem_response(struct cardstate *cs)
566 case RT_ZCAU: 566 case RT_ZCAU:
567 event->parameter = -1; 567 event->parameter = -1;
568 if (curarg + 1 < params) { 568 if (curarg + 1 < params) {
569 unsigned long type, value; 569 u8 type, value;
570
571 i = strict_strtoul(argv[curarg++], 16, &type);
572 j = strict_strtoul(argv[curarg++], 16, &value);
573 570
574 if (i == 0 && type < 256 && 571 i = kstrtou8(argv[curarg++], 16, &type);
575 j == 0 && value < 256) 572 j = kstrtou8(argv[curarg++], 16, &value);
573 if (i == 0 && j == 0)
576 event->parameter = (type << 8) | value; 574 event->parameter = (type << 8) | value;
577 } else 575 } else
578 curarg = params - 1; 576 curarg = params - 1;
579 break; 577 break;
580 case RT_NUMBER: 578 case RT_NUMBER:
581 event->parameter = -1; 579 if (curarg >= params ||
582 if (curarg < params) { 580 kstrtoint(argv[curarg++], 10, &event->parameter))
583 unsigned long res; 581 event->parameter = -1;
584 int rc;
585
586 rc = strict_strtoul(argv[curarg++], 10, &res);
587 if (rc == 0)
588 event->parameter = res;
589 }
590 gig_dbg(DEBUG_EVENT, "parameter==%d", event->parameter); 582 gig_dbg(DEBUG_EVENT, "parameter==%d", event->parameter);
591 break; 583 break;
592 } 584 }
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 2ee93d04b2dd..236cc7dadfd0 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -155,7 +155,6 @@ put_log_buffer(hysdn_card * card, char *cp)
155static ssize_t 155static ssize_t
156hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off) 156hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
157{ 157{
158 unsigned long u = 0;
159 int rc; 158 int rc;
160 unsigned char valbuf[128]; 159 unsigned char valbuf[128];
161 hysdn_card *card = file->private_data; 160 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 166
168 valbuf[count] = 0; /* terminating 0 */ 167 valbuf[count] = 0; /* terminating 0 */
169 168
170 rc = strict_strtoul(valbuf, 0, &u); 169 rc = kstrtoul(valbuf, 0, &card->debug_flags);
171 170 if (rc < 0)
172 if (rc == 0) { 171 return rc;
173 card->debug_flags = u; /* remember debug flags */ 172 hysdn_addlog(card, "debug set to 0x%lx", card->debug_flags);
174 hysdn_addlog(card, "debug set to 0x%lx", card->debug_flags);
175 }
176 return (count); 173 return (count);
177} /* hysdn_log_write */ 174} /* hysdn_log_write */
178 175