LKML Archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Joe Perches <joe@perches.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Steve French <sfrench@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"open list:TI WILINK WIRELES..." <linux-wireless@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	linux-cifs@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool
Date: Thu, 4 Feb 2016 15:11:34 -0800	[thread overview]
Message-ID: <CAGXu5jKox2cJv7OX=qkO8js0eot_+6PkNPh7gy6ZuEeqjp97xg@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfEi4umnfQoDdySn2X6ZEyL1_szzdwvjBgKy=-Uz9KbOg@mail.gmail.com>

On Thu, Feb 4, 2016 at 3:00 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook <keescook@chromium.org> wrote:
>> Add support for "on" and "off" when converting to boolean.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>>  lib/kstrtox.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/lib/kstrtox.c b/lib/kstrtox.c
>> index e18f088704d7..09e83a19a96d 100644
>> --- a/lib/kstrtox.c
>> +++ b/lib/kstrtox.c
>> @@ -347,6 +347,20 @@ int kstrtobool(const char *s, unsigned int base, bool *res)
>
> Forgot update description?

Argh, thank you. Good eye. Sent another update.

-Kees

>
>>         case '0':
>>                 *res = false;
>>                 return 0;
>> +       case 'o':
>> +       case 'O':
>> +               switch (s[1]) {
>> +               case 'n':
>> +               case 'N':
>> +                       *res = true;
>> +                       return 0;
>> +               case 'f':
>> +               case 'F':
>> +                       *res = false;
>> +                       return 0;
>> +               default:
>> +                       break;
>> +               }
>>         default:
>>                 break;
>>         }
>> --
>> 2.6.3
>>
>
>
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
Kees Cook
Chrome OS & Brillo Security

  reply	other threads:[~2016-02-04 23:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 21:00 [PATCH v2 0/4] lib: add "on" and "off" to strtobool Kees Cook
2016-02-04 21:00 ` [PATCH v2 1/4] lib: move strtobool to kstrtobool Kees Cook
2016-02-04 22:43   ` Andy Shevchenko
2016-02-04 22:48     ` Kees Cook
2016-02-04 23:55   ` Rasmus Villemoes
2016-02-05 20:50     ` Kees Cook
2016-02-04 21:00 ` [PATCH v2 2/4] lib: update single-char callers of strtobool Kees Cook
2016-02-04 22:59   ` Andy Shevchenko
2016-02-04 23:01     ` Kees Cook
2016-02-05 10:46   ` David Laight
2016-02-05 21:18     ` Kees Cook
2016-02-04 21:00 ` [PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool Kees Cook
2016-02-04 23:00   ` Andy Shevchenko
2016-02-04 23:11     ` Kees Cook [this message]
2016-02-04 21:00 ` [PATCH v2 4/4] param: convert some "on"/"off" users to strtobool Kees Cook
2016-02-04 23:04   ` Andy Shevchenko
2016-02-05  0:11     ` Kees Cook
2016-02-05  2:12       ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5jKox2cJv7OX=qkO8js0eot_+6PkNPh7gy6ZuEeqjp97xg@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=akarwar@marvell.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=joe@perches.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=nishants@marvell.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sfrench@samba.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).