lib-cmdline-allow-null-to-be-an-output-for-get_option.patch removed from -mm tree
The patch titled
Subject: lib/cmdline: allow NULL to be an output for get_option()
has been removed from the -mm tree. Its filename was
lib-cmdline-allow-null-to-be-an-output-for-get_option.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Andy Shevchenko <[email protected]>
Subject: lib/cmdline: allow NULL to be an output for get_option()
In the future we would like to use get_option() to only validate the string and parse it separately. To achieve this, allow NULL to be an output for get_option().
Signed-off-by Andy Shevchenko <[email protected]>
Cc Brendan Higgins <[email protected]>
Cc David Gow <[email protected]>
Cc Mark Brown <[email protected]>
Cc Matti Vaittinen <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Vitor Massaru Iha <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
lib/cmdline.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
lib/cmdline.c renamed from lib/cmdline.c~lib-cmdline-allow-null-to-be-an-output-for-get_option +9 -3
@@ -35,11 +35,14 @@ static int get_range(char **str, int *pi/** * get_option - Parse integer from an option string * @str: option string -* @pint: (output) integer value parsed from @str +* @pint: (optional output) integer value parsed from @str * * Read an int from an option string; if available accept a subsequent * comma as well. * +* When @pint is NULL the function can be used as a validator of +* the current option in the string. +* * Return values: * 0 - no int in string * 1 - int found, no subsequent comma
@@ -53,13 +56,16 @@ static int get_range(char **str, int *piint get_option (char **str,int *pint) {char *cur = *str; +int value;if (!cur || !(*cur))return 0 ;if (*cur =='-' ) - *pint = -simple_strtoull (++cur, str,0 ); + value = -simple_strtoull (++cur, str,0 );else - *pint =simple_strtoull (cur, str,0 ); + value =simple_strtoull (cur, str,0 ); +if (pint) + *pint = value;if (cur == *str)return 0 ;if (**str ==',' ) {
_
Patches currently in -mm which might be from [email protected] are