Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203599
b: refs/heads/master
c: 3944ad6
h: refs/heads/master
i:
  203597: 369a367
  203595: 1022664
  203591: dab6de0
  203583: 440d8e9
v: v3
  • Loading branch information
Andy Shevchenko authored and David S. Miller committed Jul 16, 2010
1 parent 2080597 commit 62a7082
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 735c65ce4a878b55e08821360fdfd42753cdbe14
refs/heads/master: 3944ad6848e7ae15a3402372a2df4ae805008321
34 changes: 6 additions & 28 deletions trunk/drivers/isdn/hysdn/hysdn_proclog.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/kernel.h>

#include "hysdn_defs.h"

Expand Down Expand Up @@ -155,9 +156,8 @@ static ssize_t
hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
{
unsigned long u = 0;
int found = 0;
unsigned char *cp, valbuf[128];
long base = 10;
int rc;
unsigned char valbuf[128];
hysdn_card *card = file->private_data;

if (count > (sizeof(valbuf) - 1))
Expand All @@ -166,32 +166,10 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t
return (-EFAULT); /* copy failed */

valbuf[count] = 0; /* terminating 0 */
cp = valbuf;
if ((count > 2) && (valbuf[0] == '0') && (valbuf[1] == 'x')) {
cp += 2; /* pointer after hex modifier */
base = 16;
}
/* scan the input for debug flags */
while (*cp) {
if ((*cp >= '0') && (*cp <= '9')) {
found = 1;
u *= base; /* adjust to next digit */
u += *cp++ - '0';
continue;
}
if (base != 16)
break; /* end of number */

if ((*cp >= 'a') && (*cp <= 'f')) {
found = 1;
u *= base; /* adjust to next digit */
u += *cp++ - 'a' + 10;
continue;
}
break; /* terminated */
}

if (found) {
rc = strict_strtoul(valbuf, 0, &u);

if (rc == 0) {
card->debug_flags = u; /* remember debug flags */
hysdn_addlog(card, "debug set to 0x%lx", card->debug_flags);
}
Expand Down

0 comments on commit 62a7082

Please sign in to comment.