memparse(): constify argument
PATCH 1/3 memparse(): constify argument
memparse()'s first argument can be const, so it should be.
---
include/linux/kernel.h | 2 +- lib/cmdline.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
===================================================================
include/linux/kernel.h +0 -0
@@ -174,7 +174,7 @@
extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints); -extern unsigned long long memparse(char *ptr, char **retptr); +extern unsigned long long memparse(const char *ptr, char **retptr);
extern int core_kernel_text(unsigned long addr); extern int __kernel_text_address(unsigned long addr);
===================================================================
lib/cmdline.c +1 -1
@@ -126,9 +126,9 @@* megabyte, or one gigabyte, respectively. */ -unsigned long long memparse (char *ptr,char **retptr) +unsigned long long memparse (const char *ptr,char **retptr)
{
- unsigned long long ret = simple_strtoull (ptr, retptr, 0);
+ unsigned long long ret = simple_strtoull(ptr, retptr, 0);
switch (**retptr) {
case 'G':Quoted 3 lines · Jeremy Fitzhardinge
memparse()'s first argument can be const, so it should be.
Signed-off-by Jeremy Fitzhardinge <[email protected]>
this one clashed with upstream commit v2.6.26-6912-gfd19382, i've fixed it up as below.
Ingo
-------
Subject: generic, memparse(): constify argument
From: Jeremy Fitzhardinge <[email protected]>
Date: Thu, 24 Jul 2008 16:27:46 -0700
memparse()'s first argument can be const, so it should be.
--- include/linux/kernel.h | 2 +- lib/cmdline.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
include/linux/kernel.h +1 -1
@@ -176,7 +176,7 @@ extern int vsscanf(const char *, const cextern int get_option (char **str,int *pint);extern char *get_options (const char *str,int nints,int *ints); -extern unsigned long long memparse (char *ptr,char **retptr); +extern unsigned long long memparse (const char *ptr,char **retptr);extern int core_kernel_text (unsigned long addr);extern int __kernel_text_address (unsigned long addr);
lib/cmdline.c +1 -1
@@ -126,7 +126,7 @@ char *get_options(const char *str, int n* megabyte, or one gigabyte, respectively. */ -unsigned long long memparse (char *ptr,char **retptr) +unsigned long long memparse (const char *ptr,char **retptr) {char *endptr;/* local pointer to end of parsed string */
Ingo Molnar
AppliedQuoted 1 line · Jeremy Fitzhardinge
memparse()'s first argument can be const, so it should be.
i've picked this up into tip/core/lib - if Andrew wants to have the same commit ID it can be pulled from there, as per the coordinates below.
I've merged that branch into tip/x86/xen, and i've applied your other two dependent changes to tip/x86/xen too.
Ingo
------------------>
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core/lib
Jeremy Fitzhardinge (1):
generic, memparse(): constify argument
include/linux/kernel.h | 2 +- lib/cmdline.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/kernel.h +1 -1
@@ -176,7 +176,7 @@ extern int vsscanf(const char *, const char *, va_list)extern int get_option (char **str,int *pint);extern char *get_options (const char *str,int nints,int *ints); -extern unsigned long long memparse (char *ptr,char **retptr); +extern unsigned long long memparse (const char *ptr,char **retptr);extern int core_kernel_text (unsigned long addr);extern int __kernel_text_address (unsigned long addr);
lib/cmdline.c +1 -1
@@ -126,7 +126,7 @@ char *get_options(const char *str, int nints, int *ints)* megabyte, or one gigabyte, respectively. */ -unsigned long long memparse (char *ptr,char **retptr) +unsigned long long memparse (const char *ptr,char **retptr) {char *endptr;/* local pointer to end of parsed string */