Commit 359d6255 authored by Eric Biggers's avatar Eric Biggers Committed by Andrew Morton

lib: parser: update documentation for match_NUMBER functions

commit 67222c4b ("lib: parser: optimize match_NUMBER apis to use local
array") removed -ENOMEM as a possible return value, so update the comments
accordingly.

Link: https://lkml.kernel.org/r/20230224042618.9092-1-ebiggers@kernel.org
Fixes: 67222c4b ("lib: parser: optimize match_NUMBER apis to use local array")
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Cc: Li Lingfeng <lilingfeng3@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yu Kuai <yukuai1@huaweicloud.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 4ec4190b
...@@ -133,7 +133,7 @@ EXPORT_SYMBOL(match_token); ...@@ -133,7 +133,7 @@ EXPORT_SYMBOL(match_token);
* as a number in that base. * as a number in that base.
* *
* Return: On success, sets @result to the integer represented by the * Return: On success, sets @result to the integer represented by the
* string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * string and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
static int match_number(substring_t *s, int *result, int base) static int match_number(substring_t *s, int *result, int base)
{ {
...@@ -165,7 +165,7 @@ static int match_number(substring_t *s, int *result, int base) ...@@ -165,7 +165,7 @@ static int match_number(substring_t *s, int *result, int base)
* as a number in that base. * as a number in that base.
* *
* Return: On success, sets @result to the integer represented by the * Return: On success, sets @result to the integer represented by the
* string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * string and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
static int match_u64int(substring_t *s, u64 *result, int base) static int match_u64int(substring_t *s, u64 *result, int base)
{ {
...@@ -189,7 +189,7 @@ static int match_u64int(substring_t *s, u64 *result, int base) ...@@ -189,7 +189,7 @@ static int match_u64int(substring_t *s, u64 *result, int base)
* Description: Attempts to parse the &substring_t @s as a decimal integer. * Description: Attempts to parse the &substring_t @s as a decimal integer.
* *
* Return: On success, sets @result to the integer represented by the string * Return: On success, sets @result to the integer represented by the string
* and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
int match_int(substring_t *s, int *result) int match_int(substring_t *s, int *result)
{ {
...@@ -205,7 +205,7 @@ EXPORT_SYMBOL(match_int); ...@@ -205,7 +205,7 @@ EXPORT_SYMBOL(match_int);
* Description: Attempts to parse the &substring_t @s as a decimal integer. * Description: Attempts to parse the &substring_t @s as a decimal integer.
* *
* Return: On success, sets @result to the integer represented by the string * Return: On success, sets @result to the integer represented by the string
* and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
int match_uint(substring_t *s, unsigned int *result) int match_uint(substring_t *s, unsigned int *result)
{ {
...@@ -228,7 +228,7 @@ EXPORT_SYMBOL(match_uint); ...@@ -228,7 +228,7 @@ EXPORT_SYMBOL(match_uint);
* integer. * integer.
* *
* Return: On success, sets @result to the integer represented by the string * Return: On success, sets @result to the integer represented by the string
* and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
int match_u64(substring_t *s, u64 *result) int match_u64(substring_t *s, u64 *result)
{ {
...@@ -244,7 +244,7 @@ EXPORT_SYMBOL(match_u64); ...@@ -244,7 +244,7 @@ EXPORT_SYMBOL(match_u64);
* Description: Attempts to parse the &substring_t @s as an octal integer. * Description: Attempts to parse the &substring_t @s as an octal integer.
* *
* Return: On success, sets @result to the integer represented by the string * Return: On success, sets @result to the integer represented by the string
* and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
int match_octal(substring_t *s, int *result) int match_octal(substring_t *s, int *result)
{ {
...@@ -260,7 +260,7 @@ EXPORT_SYMBOL(match_octal); ...@@ -260,7 +260,7 @@ EXPORT_SYMBOL(match_octal);
* Description: Attempts to parse the &substring_t @s as a hexadecimal integer. * Description: Attempts to parse the &substring_t @s as a hexadecimal integer.
* *
* Return: On success, sets @result to the integer represented by the string * Return: On success, sets @result to the integer represented by the string
* and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure. * and returns 0. Returns -EINVAL or -ERANGE on failure.
*/ */
int match_hex(substring_t *s, int *result) int match_hex(substring_t *s, int *result)
{ {
......
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