Commit 7d5d688f authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] Use simple_strtoul instead of own cmm_strtoul wrapper.

Fix compile warning with some configurations:

arch/s390/mm/cmm.c:58: warning: 'cmm_strtoul' defined but not used

Originally cmm_strtoul was introduced because simple_strtoul couldn't
handle strings with hexadecimal numbers that contained a capital 'X'.
Since this is no longer true cmm_strtoul can be removed.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 83014255
...@@ -52,22 +52,6 @@ static struct timer_list cmm_timer; ...@@ -52,22 +52,6 @@ static struct timer_list cmm_timer;
static void cmm_timer_fn(unsigned long); static void cmm_timer_fn(unsigned long);
static void cmm_set_timer(void); 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 static long
cmm_alloc_pages(long pages, long *counter, struct cmm_page_array **list) cmm_alloc_pages(long pages, long *counter, struct cmm_page_array **list)
{ {
...@@ -276,7 +260,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -276,7 +260,7 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT; return -EFAULT;
buf[sizeof(buf) - 1] = '\0'; buf[sizeof(buf) - 1] = '\0';
cmm_skip_blanks(buf, &p); cmm_skip_blanks(buf, &p);
pages = cmm_strtoul(p, &p); pages = simple_strtoul(p, &p, 0);
if (ctl == &cmm_table[0]) if (ctl == &cmm_table[0])
cmm_set_pages(pages); cmm_set_pages(pages);
else else
...@@ -317,9 +301,9 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp, ...@@ -317,9 +301,9 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT; return -EFAULT;
buf[sizeof(buf) - 1] = '\0'; buf[sizeof(buf) - 1] = '\0';
cmm_skip_blanks(buf, &p); cmm_skip_blanks(buf, &p);
pages = cmm_strtoul(p, &p); pages = simple_strtoul(p, &p, 0);
cmm_skip_blanks(p, &p); cmm_skip_blanks(p, &p);
seconds = cmm_strtoul(p, &p); seconds = simple_strtoul(p, &p, 0);
cmm_set_timeout(pages, seconds); cmm_set_timeout(pages, seconds);
} else { } else {
len = sprintf(buf, "%ld %ld\n", len = sprintf(buf, "%ld %ld\n",
...@@ -382,24 +366,24 @@ cmm_smsg_target(char *from, char *msg) ...@@ -382,24 +366,24 @@ cmm_smsg_target(char *from, char *msg)
if (strncmp(msg, "SHRINK", 6) == 0) { if (strncmp(msg, "SHRINK", 6) == 0) {
if (!cmm_skip_blanks(msg + 6, &msg)) if (!cmm_skip_blanks(msg + 6, &msg))
return; return;
pages = cmm_strtoul(msg, &msg); pages = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg); cmm_skip_blanks(msg, &msg);
if (*msg == '\0') if (*msg == '\0')
cmm_set_pages(pages); cmm_set_pages(pages);
} else if (strncmp(msg, "RELEASE", 7) == 0) { } else if (strncmp(msg, "RELEASE", 7) == 0) {
if (!cmm_skip_blanks(msg + 7, &msg)) if (!cmm_skip_blanks(msg + 7, &msg))
return; return;
pages = cmm_strtoul(msg, &msg); pages = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg); cmm_skip_blanks(msg, &msg);
if (*msg == '\0') if (*msg == '\0')
cmm_add_timed_pages(pages); cmm_add_timed_pages(pages);
} else if (strncmp(msg, "REUSE", 5) == 0) { } else if (strncmp(msg, "REUSE", 5) == 0) {
if (!cmm_skip_blanks(msg + 5, &msg)) if (!cmm_skip_blanks(msg + 5, &msg))
return; return;
pages = cmm_strtoul(msg, &msg); pages = simple_strtoul(msg, &msg, 0);
if (!cmm_skip_blanks(msg, &msg)) if (!cmm_skip_blanks(msg, &msg))
return; return;
seconds = cmm_strtoul(msg, &msg); seconds = simple_strtoul(msg, &msg, 0);
cmm_skip_blanks(msg, &msg); cmm_skip_blanks(msg, &msg);
if (*msg == '\0') if (*msg == '\0')
cmm_set_timeout(pages, seconds); cmm_set_timeout(pages, seconds);
......
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