From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05D26C433FE for ; Tue, 26 Apr 2022 17:24:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 707F66B0073; Tue, 26 Apr 2022 13:24:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B7BB6B0074; Tue, 26 Apr 2022 13:24:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57F0B6B0075; Tue, 26 Apr 2022 13:24:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 460B46B0073 for ; Tue, 26 Apr 2022 13:24:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 089046105D for ; Tue, 26 Apr 2022 17:24:03 +0000 (UTC) X-FDA: 79399703166.01.F518427 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP id 03EE51C0059 for ; Tue, 26 Apr 2022 17:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nLgSZUMwQnFAuxlmgrnwtm2dKOz4jDnWEc3lRX/F6/Q=; b=QDyaK2XZZeViD7XYHreQEDTutF z1mG4F6oF/QZVHeCGTtOsfJUHn04AzyngpmX3AxG+NFJK+CuwkkYyrIPDptNTUJ0Pps26Ig3fGG68 cVy2Bl2FC8+5njbfbPC049roQEmjSnGumCWFKx7PqjWWm6XkHE6Tsk9suhp+R6vOmnl9Bk0wXgziA Li99k3+IVCohq07ezZdm90jDKaWyVW/XtKFAj/lYbA3Ko6ra4wauKNO4t+kjG7kdGsllRbX9RS9/6 LtWyi5nMKncAu5gtGK8BzSDOSgDeb6dH8I0BuqD85FB0J8k9GOEV3tgYcrP6FhraZ2OfQtGch/gJG mTrhZ8UQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1njOul-009qt1-26; Tue, 26 Apr 2022 17:23:51 +0000 Date: Tue, 26 Apr 2022 18:23:51 +0100 From: Matthew Wilcox To: Jagdish Gediya Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jonathan.Cameron@huawei.com, adobriyan@gmail.com, akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, rf@opensource.cirrus.com, pmladek@suse.com, ying.huang@intel.com, dave.hansen@intel.com Subject: Re: [PATCH v2 1/2] lib/kstrtox.c: Add "false"/"true" support to kstrtobool() Message-ID: References: <20220426170040.65487-1-jvgediya@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220426170040.65487-1-jvgediya@linux.ibm.com> X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 03EE51C0059 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QDyaK2XZ; spf=none (imf20.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Stat-Signature: ebxpsmgfuzsw6shaq3u9s5i5dxianidq X-HE-Tag: 1650993838-51287 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Apr 26, 2022 at 10:30:39PM +0530, Jagdish Gediya wrote: > At many places in kernel, It is necessary to convert sysfs input > to corrosponding bool value e.g. "false" or "0" need to be converted > to bool false, "true" or "1" need to be converted to bool true, > places where such conversion is needed currently check the input > string manually, kstrtobool() can be utilized at such places but > currently it doesn't have support to accept "false"/"true". > > Add support to accept "false"/"true" as valid string in kstrtobool(). > > Signed-off-by: Jagdish Gediya Reviewed-by: Matthew Wilcox (Oracle) ... except ... > - * This routine returns 0 iff the first character is one of 'Yy1Nn0', or > + * This routine returns 0 if the first character is one of 'YyTt1NnFf0', or https://en.wikipedia.org/wiki/If_and_only_if