Re: [PATCH net-next 2/2] netconsole: Use kstrtobool() instead of kstrtoint()

From: Simon Horman
Date: Mon Jul 24 2023 - 10:28:16 EST


On Fri, Jul 21, 2023 at 02:21:45AM -0700, Breno Leitao wrote:
> Replace kstrtoint() by kstrtobool() in the sysfs _store() functions.
> This improves the user usability and simplify the code.
>
> With this fix, it is now possible to use [YyNn] to set and unset a
> feature. Old behaviour is still unchanged.
>
> kstrtobool() is also safer and doesn't need the extra validation that
> is required when converting a string to bool (end field in the struct),
> which makes the code simpler.
>
> Suggested-by: Petr Mladek <pmladek@xxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>

Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>