lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] lib/kstrtox.c: Add "false"/"true" support to kstrtobool()
On Tue, Apr 26, 2022 at 10:30:39PM +0530, Jagdish Gediya wrote:
> At many places in kernel, It is necessary to convert sysfs input
> to corrosponding bool value e.g. "false" or "0" need to be converted
> to bool false, "true" or "1" need to be converted to bool true,
> places where such conversion is needed currently check the input
> string manually, kstrtobool() can be utilized at such places but
> currently it doesn't have support to accept "false"/"true".
>
> Add support to accept "false"/"true" as valid string in kstrtobool().
>
> Signed-off-by: Jagdish Gediya <jvgediya@linux.ibm.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

... except ...

> - * This routine returns 0 iff the first character is one of 'Yy1Nn0', or
> + * This routine returns 0 if the first character is one of 'YyTt1NnFf0', or

https://en.wikipedia.org/wiki/If_and_only_if

\
 
 \ /
  Last update: 2022-04-26 19:25    [W:0.083 / U:1.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site