Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705AbcD2VVN (ORCPT ); Fri, 29 Apr 2016 17:21:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44522 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbcD2VVL (ORCPT ); Fri, 29 Apr 2016 17:21:11 -0400 Date: Fri, 29 Apr 2016 14:21:10 -0700 From: Andrew Morton To: Minfei Huang Cc: labbott@fedoraproject.org, rjw@rjwysocki.net, mgorman@techsingularity.net, mhocko@suse.com, vbabka@suse.cz, rientjes@google.com, kirill.shutemov@linux.intel.com, iamjoonsoo.kim@lge.com, izumi.taku@jp.fujitsu.com, alexander.h.duyck@redhat.com, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Use existing helper to convert "on/off" to boolean Message-Id: <20160429142110.b4039a422866754bc914b8b2@linux-foundation.org> In-Reply-To: <1461908824-16129-1-git-send-email-mnghuan@gmail.com> References: <1461908824-16129-1-git-send-email-mnghuan@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 691 Lines: 21 On Fri, 29 Apr 2016 13:47:04 +0800 Minfei Huang wrote: > It's more convenient to use existing function helper to convert string > "on/off" to boolean. > > ... > > --- a/lib/kstrtox.c > +++ b/lib/kstrtox.c > @@ -326,7 +326,7 @@ EXPORT_SYMBOL(kstrtos8); > * @s: input string > * @res: result > * > - * This routine returns 0 iff the first character is one of 'Yy1Nn0', or > + * This routine returns 0 if the first character is one of 'Yy1Nn0', or That isn't actually a typo. "iff" is shorthand for "if and only if". ie: kstrtobool() will not return 0 in any other case. Use of "iff" is a bit pretentious but I guess it does convey some conceivably useful info.