Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34170
b: refs/heads/master
c: 7d5d688
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Sep 20, 2006
1 parent 19aa59c commit adb759f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 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: 8301425534b87bae9990261f3008f39999be738c
refs/heads/master: 7d5d688f724dd5a651d1ce7bc3ea7c03d28137a1
30 changes: 7 additions & 23 deletions trunk/arch/s390/mm/cmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@ static struct timer_list cmm_timer;
static void cmm_timer_fn(unsigned long);
static void cmm_set_timer(void);

static long
cmm_strtoul(const char *cp, char **endp)
{
unsigned int base = 10;

if (*cp == '0') {
base = 8;
cp++;
if ((*cp == 'x' || *cp == 'X') && isxdigit(cp[1])) {
base = 16;
cp++;
}
}
return simple_strtoul(cp, endp, base);
}

static long
cmm_alloc_pages(long pages, long *counter, struct cmm_page_array **list)
{
Expand Down Expand Up @@ -276,7 +260,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT;
buf[sizeof(buf) - 1] = '\0';
cmm_skip_blanks(buf, &p);
pages = cmm_strtoul(p, &p);
pages = simple_strtoul(p, &p, 0);
if (ctl == &cmm_table[0])
cmm_set_pages(pages);
else
Expand Down Expand Up @@ -317,9 +301,9 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT;
buf[sizeof(buf) - 1] = '\0';
cmm_skip_blanks(buf, &p);
pages = cmm_strtoul(p, &p);
pages = simple_strtoul(p, &p, 0);
cmm_skip_blanks(p, &p);
seconds = cmm_strtoul(p, &p);
seconds = simple_strtoul(p, &p, 0);
cmm_set_timeout(pages, seconds);
} else {
len = sprintf(buf, "%ld %ld\n",
Expand Down Expand Up @@ -382,24 +366,24 @@ cmm_smsg_target(char *from, char *msg)
if (strncmp(msg, "SHRINK", 6) == 0) {
if (!cmm_skip_blanks(msg + 6, &msg))
return;
pages = cmm_strtoul(msg, &msg);
pages = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg);
if (*msg == '\0')
cmm_set_pages(pages);
} else if (strncmp(msg, "RELEASE", 7) == 0) {
if (!cmm_skip_blanks(msg + 7, &msg))
return;
pages = cmm_strtoul(msg, &msg);
pages = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg);
if (*msg == '\0')
cmm_add_timed_pages(pages);
} else if (strncmp(msg, "REUSE", 5) == 0) {
if (!cmm_skip_blanks(msg + 5, &msg))
return;
pages = cmm_strtoul(msg, &msg);
pages = simple_strtoul(msg, &msg, 0);
if (!cmm_skip_blanks(msg, &msg))
return;
seconds = cmm_strtoul(msg, &msg);
seconds = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg);
if (*msg == '\0')
cmm_set_timeout(pages, seconds);
Expand Down

0 comments on commit adb759f

Please sign in to comment.