Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1390930

Re: [PATCH] Use existing helper to convert "on/off" to boolean

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] Use existing helper to convert "on/off" to boolean
Date 2016-04-29 11:30 +0200
Message-ID <rtcUi-3th-27@gated-at.bofh.it> (permalink)
References <rt9to-KD-5@gated-at.bofh.it> <rtbES-2B9-21@gated-at.bofh.it> <rtcAW-3l0-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 29-04-16 17:07:42, Minfei Huang wrote:
> On 04/29/16 at 10:04P, Michal Hocko wrote:
> > On Fri 29-04-16 13:47:04, Minfei Huang wrote:
> > > It's more convenient to use existing function helper to convert string
> > > "on/off" to boolean.
> > 
> > But kstrtobool in linux-next only does "This routine returns 0 iff the
> > first character is one of 'Yy1Nn0'" so it doesn't know about on/off.
> > Or am I missing anything?
> 
> Hi, Michal.
> 
> Thanks for your reply.
> 
> Following is the kstrtobool comment from linus tree, which has explained
> that this function can parse "on"/"off" string. Also Kees Cook has
> posted such patch to fix this issue as well. So I think it's safe to fix
> it.

OK, I was looking at wrong tree and missed a81a5a17d44b ("lib: add
"on"/"off" support to kstrtobool")

Sorry about the confusion. Feel free to add
Acked-by: Michal Hocko <mhocko@suse.com>
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Use existing helper to convert "on/off" to boolean Minfei Huang <mnghuan@gmail.com> - 2016-04-29 07:50 +0200
  Re: [PATCH] Use existing helper to convert "on/off" to boolean Michal Hocko <mhocko@kernel.org> - 2016-04-29 10:10 +0200
    Re: [PATCH] Use existing helper to convert "on/off" to boolean Minfei Huang <mnghuan@gmail.com> - 2016-04-29 11:10 +0200
      Re: [PATCH] Use existing helper to convert "on/off" to boolean Michal Hocko <mhocko@kernel.org> - 2016-04-29 11:30 +0200
  Re: [PATCH] Use existing helper to convert "on/off" to boolean Andrew Morton <akpm@linux-foundation.org> - 2016-04-29 23:30 +0200
    Re: [PATCH] Use existing helper to convert "on/off" to boolean Minfei Huang <mnghuan@gmail.com> - 2016-04-30 06:50 +0200

csiph-web