Message ID | 4311e9cb62687449f4175e2b062abcd77aada059.1667336095.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3212844wru; Tue, 1 Nov 2022 14:16:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QtkZ7O7Lxx2FYncTzNTw+7AiKvEAG/QVpevi+fAkFpvcxKzueNXAu8iqw8An9D7gybdAl X-Received: by 2002:a63:ce54:0:b0:46a:e2a9:c7f6 with SMTP id r20-20020a63ce54000000b0046ae2a9c7f6mr18608595pgi.264.1667337412634; Tue, 01 Nov 2022 14:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667337412; cv=none; d=google.com; s=arc-20160816; b=WI9jFLiem6p6ovgADIAOxUiz0FYHvp2sdOTSMpniRU1klwqVuyCQi4slppS7LnpxsY 6QSsdwlcFb4qBxgafdJCmFbtc9lnecChZmCmS6/YAQtZ8+9BM9UHKUWPDi6UFBxv2HUe RJp7o8uixsHHxY2rt3UkawRWXw4gazTGlWiDF8wLsArxeQEpVTkLPr2ejYzOK0vElhJ0 wxQUZwI/bPws81Hb1Aaa9RU9+KnlKEYY9sjeHNrv+JVy71u8O9dh0Ps9GTdNqBlKQ0Uc J23qr0BkVx9dUE1XqyNeivFUu5VZhO6P0zx0vsrCz+5+S39oWrWv9hDXPNnFW+bdQl6Q KvWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IP+vwpC5w0lgTjJIfly+G6bIfvDlhjiYE9yhpNMCwlM=; b=RVx3gT5qHACoYXrGOmMfZiBEr9ddjFhamuVpT2jjj+wVRPuvXfd0EMQ+BAECZl2x57 vKvhqc7w0aH06o/nul3loNLcC9nS5InESNFqkofCdCixVcd87Q206+9yE9xBAshe2yxx R4zHSof+vanTsevulhkjYW5GR5w+807rd2RVeWZo8cj82RsupmW17wttFZvQbvVBDRiS +FUc8T9xPJfrI2+4vQlQyczpvqiNsnlXkyRwUhCFGAavWW2gIRADoq4JpTULE+2i/zJ4 n4gmAbHL343/E/2S5kn2fZ9JOJpnNmsnsqA6d/5NaMmgT4XWImpMaA86THbp1YE4E6+L Pxiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu7-20020a17090b1b0700b00213a9e1fa86si16763761pjb.73.2022.11.01.14.16.38; Tue, 01 Nov 2022 14:16:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbiKAVQF (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 1 Nov 2022 17:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbiKAVPb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Nov 2022 17:15:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 850991F2C7 for <linux-kernel@vger.kernel.org>; Tue, 1 Nov 2022 14:15:17 -0700 (PDT) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id pyanoKD2rsfCIpybLoWfJW; Tue, 01 Nov 2022 22:15:15 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 01 Nov 2022 22:15:15 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-input@vger.kernel.org Subject: [PATCH 12/30] input: Use kstrtobool() instead of strtobool() Date: Tue, 1 Nov 2022 22:14:00 +0100 Message-Id: <4311e9cb62687449f4175e2b062abcd77aada059.1667336095.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1667336095.git.christophe.jaillet@wanadoo.fr> References: <cover.1667336095.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748329995273966866?= X-GMAIL-MSGID: =?utf-8?q?1748329995273966866?= |
Series |
Remove strtobool()
|
|
Commit Message
Christophe JAILLET
Nov. 1, 2022, 9:14 p.m. UTC
strtobool() is the same as kstrtobool().
However, the latter is more used within the kernel.
In order to remove strtobool() and slightly simplify kstrtox.h, switch to
the other function name.
While at it, include the corresponding header file (<linux/kstrtox.h>)
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is part of a serie that axes all usages of strtobool().
Each patch can be applied independently from the other ones.
The last patch of the serie removes the definition of strtobool().
You may not be in copy of the cover letter. So, if needed, it is available
at [1].
[1]: https://lore.kernel.org/all/cover.1667336095.git.christophe.jaillet@wanadoo.fr/
---
drivers/input/input.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Tue, Nov 01, 2022 at 10:14:00PM +0100, Christophe JAILLET wrote: > strtobool() is the same as kstrtobool(). > However, the latter is more used within the kernel. > > In order to remove strtobool() and slightly simplify kstrtox.h, switch to > the other function name. > > While at it, include the corresponding header file (<linux/kstrtox.h>) > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Please feel free to merge with the rest of the series. Or let me know if you want me to pick just this one through my tree. Thanks.
Le 03/11/2022 à 21:46, Dmitry Torokhov a écrit : > On Tue, Nov 01, 2022 at 10:14:00PM +0100, Christophe JAILLET wrote: >> strtobool() is the same as kstrtobool(). >> However, the latter is more used within the kernel. >> >> In order to remove strtobool() and slightly simplify kstrtox.h, switch to >> the other function name. >> >> While at it, include the corresponding header file (<linux/kstrtox.h>) >> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > Please feel free to merge with the rest of the series. Or let me know if > you want me to pick just this one through my tree. > > Thanks. > Hi, the patch can go through your tree. There is no plan to merge the whole serie at once, and some other maintainers have asked for some patches to be re-sent as individual patches. CJ
On Thu, Nov 03, 2022 at 10:37:19PM +0100, Christophe JAILLET wrote: > Le 03/11/2022 à 21:46, Dmitry Torokhov a écrit : > > On Tue, Nov 01, 2022 at 10:14:00PM +0100, Christophe JAILLET wrote: > > > strtobool() is the same as kstrtobool(). > > > However, the latter is more used within the kernel. > > > > > > In order to remove strtobool() and slightly simplify kstrtox.h, switch to > > > the other function name. > > > > > > While at it, include the corresponding header file (<linux/kstrtox.h>) > > > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > > > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > > > Please feel free to merge with the rest of the series. Or let me know if > > you want me to pick just this one through my tree. > > > > Thanks. > > > > Hi, > > the patch can go through your tree. > There is no plan to merge the whole serie at once, and some other > maintainers have asked for some patches to be re-sent as individual patches. OK, applied, thank you.
diff --git a/drivers/input/input.c b/drivers/input/input.c index ebb2b7f0f8ff..783961df3626 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -21,6 +21,7 @@ #include <linux/seq_file.h> #include <linux/poll.h> #include <linux/device.h> +#include <linux/kstrtox.h> #include <linux/mutex.h> #include <linux/rcupdate.h> #include "input-compat.h" @@ -1465,7 +1466,7 @@ static ssize_t inhibited_store(struct device *dev, ssize_t rv; bool inhibited; - if (strtobool(buf, &inhibited)) + if (kstrtobool(buf, &inhibited)) return -EINVAL; if (inhibited)