[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2b423da0-60da-9712-b75c-3ca41ee56634@infradead.org>
Date: Wed, 27 Jan 2021 19:27:30 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: bingjingc <bingjingc@...ology.com>, viro@...iv.linux.org.uk,
jack@...e.com, jack@...e.cz, axboe@...nel.dk,
linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, cccheng@...ology.com,
robbieko@...ology.com
Subject: Re: [PATCH 3/3] parser: add unsigned int parser
Hi,
On 1/27/21 6:20 PM, bingjingc wrote:
> From: BingJing Chang <bingjingc@...ology.com>
>
> Will be used by fs parsing options
>
> Reviewed-by: Robbie Ko<robbieko@...ology.com>
> Reviewed-by: Chung-Chiang Cheng <cccheng@...ology.com>
> Signed-off-by: BingJing Chang <bingjingc@...ology.com>
> ---
> fs/isofs/inode.c | 16 ++--------------
> fs/udf/super.c | 16 ++--------------
> include/linux/parser.h | 1 +
> lib/parser.c | 22 ++++++++++++++++++++++
> 4 files changed, 27 insertions(+), 28 deletions(-)
[snip]
> diff --git a/lib/parser.c b/lib/parser.c
> index f5b3e5d..2ec9c4f 100644
> --- a/lib/parser.c
> +++ b/lib/parser.c
> @@ -189,6 +189,28 @@ int match_int(substring_t *s, int *result)
> EXPORT_SYMBOL(match_int);
>
> /**
> + * match_uint: - scan a decimal representation of an integer from a substring_t
This shows us that all of the kernel-doc for functions in
lib/parser.c is formatted incorrectly.
The above should be:
* match_uint - scan a decimal representation of an integer from a substring_t
i.e., drop the ':' only on the function name lines, for all functions in
this source file.
If you don't want to do that, I'll plan to do it.
> + * @s: substring_t to be scanned
> + * @result: resulting integer on success
> + *
> + * Description: Attempts to parse the &substring_t @s as a decimal integer. On
> + * success, sets @result to the integer represented by the string and returns 0.
> + * Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
> + */
> +int match_uint(substring_t *s, unsigned int *result)
> +{
> + int err = -ENOMEM;
> + char *buf = match_strdup(s);
> +
> + if (buf) {
> + err = kstrtouint(buf, 10, result);
> + kfree(buf);
> + }
> + return err;
> +}
> +EXPORT_SYMBOL(match_uint);
> +
> +/**
> * match_u64: - scan a decimal representation of a u64 from
> * a substring_t
ditto.
> * @s: substring_t to be scanned
>
thanks.
--
~Randy
Powered by blists - more mailing lists