Re: [PATCH] lib: Extend kstrtobool() to accept "true"/"false"

From: Andrew Morton
Date: Tue Jun 30 2020 - 22:38:39 EST


On Mon, 29 Jun 2020 14:09:38 +0200 Pavel Machek <pavel@xxxxxx> wrote:

> > Extend the strings recognised by kstrtobool() to cover:
> >
> > - 1/0
> > - y/n
> > - yes/no (new)
> > - t/f (new)
> > - true/false (new)
> > - on/off
>
> Is it good idea to add more values there? It is easy to do, but... we don't want
> people to use this by hand, and ideally everyone would just use 1/0...
>
> I also see potential for confusion... as in echo off > enable_off_mode (ok, this is
> with existing code, but...)
>
> Plus, if programs learn to do "echo true > ..." they will stop working on older kernels.

I'm inclined to agree with this, It is indeed an invitation to write
non-back-compatible userspace and it simply makes the kernel interface
more complex.