linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
       [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
@ 2022-11-01 21:13 ` Christophe JAILLET
  2022-11-02  5:52   ` Chaitanya Kulkarni
  2022-11-02  6:47   ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-11-01 21:13 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-nvme

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/nvme/host/pci.c        |  3 ++-
 drivers/nvme/target/configfs.c | 17 +++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5f1d71ac0086..7c83dfd1bca6 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/kstrtox.h>
 #include <linux/memremap.h>
 #include <linux/mm.h>
 #include <linux/module.h>
@@ -2186,7 +2187,7 @@ static ssize_t hmb_store(struct device *dev, struct device_attribute *attr,
 	bool new;
 	int ret;
 
-	if (strtobool(buf, &new) < 0)
+	if (kstrtobool(buf, &new) < 0)
 		return -EINVAL;
 
 	if (new == ndev->hmb)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 9443ee1d4ae3..3eb8bdd4d464 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2015-2016 HGST, a Western Digital Company.
  */
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/kstrtox.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -267,7 +268,7 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item,
 	struct nvmet_port *port = to_nvmet_port(item);
 	bool val;
 
-	if (strtobool(page, &val))
+	if (kstrtobool(page, &val))
 		return -EINVAL;
 
 	if (nvmet_is_port_enabled(port, __func__))
@@ -532,7 +533,7 @@ static ssize_t nvmet_ns_enable_store(struct config_item *item,
 	bool enable;
 	int ret = 0;
 
-	if (strtobool(page, &enable))
+	if (kstrtobool(page, &enable))
 		return -EINVAL;
 
 	if (enable)
@@ -556,7 +557,7 @@ static ssize_t nvmet_ns_buffered_io_store(struct config_item *item,
 	struct nvmet_ns *ns = to_nvmet_ns(item);
 	bool val;
 
-	if (strtobool(page, &val))
+	if (kstrtobool(page, &val))
 		return -EINVAL;
 
 	mutex_lock(&ns->subsys->lock);
@@ -579,7 +580,7 @@ static ssize_t nvmet_ns_revalidate_size_store(struct config_item *item,
 	struct nvmet_ns *ns = to_nvmet_ns(item);
 	bool val;
 
-	if (strtobool(page, &val))
+	if (kstrtobool(page, &val))
 		return -EINVAL;
 
 	if (!val)
@@ -728,7 +729,7 @@ static ssize_t nvmet_passthru_enable_store(struct config_item *item,
 	bool enable;
 	int ret = 0;
 
-	if (strtobool(page, &enable))
+	if (kstrtobool(page, &enable))
 		return -EINVAL;
 
 	if (enable)
@@ -995,7 +996,7 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item,
 	bool allow_any_host;
 	int ret = 0;
 
-	if (strtobool(page, &allow_any_host))
+	if (kstrtobool(page, &allow_any_host))
 		return -EINVAL;
 
 	down_write(&nvmet_config_sem);
@@ -1272,7 +1273,7 @@ static ssize_t nvmet_subsys_attr_pi_enable_store(struct config_item *item,
 	struct nvmet_subsys *subsys = to_subsys(item);
 	bool pi_enable;
 
-	if (strtobool(page, &pi_enable))
+	if (kstrtobool(page, &pi_enable))
 		return -EINVAL;
 
 	subsys->pi_support = pi_enable;
@@ -1392,7 +1393,7 @@ static ssize_t nvmet_referral_enable_store(struct config_item *item,
 	struct nvmet_port *port = to_nvmet_port(item);
 	bool enable;
 
-	if (strtobool(page, &enable))
+	if (kstrtobool(page, &enable))
 		goto inval;
 
 	if (enable)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
  2022-11-01 21:13 ` [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool() Christophe JAILLET
@ 2022-11-02  5:52   ` Chaitanya Kulkarni
  2022-11-02  6:47   ` Christoph Hellwig
  1 sibling, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2022-11-02  5:52 UTC (permalink / raw)
  To: Christophe JAILLET, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Chaitanya Kulkarni
  Cc: linux-kernel, kernel-janitors, linux-nvme

On 11/1/22 14:13, 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>
> ---
> 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/
> ---

I believe you have tested this patch thoroughly, with that,

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
  2022-11-01 21:13 ` [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool() Christophe JAILLET
  2022-11-02  5:52   ` Chaitanya Kulkarni
@ 2022-11-02  6:47   ` Christoph Hellwig
  2022-11-02  6:57     ` Christophe JAILLET
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2022-11-02  6:47 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, linux-kernel, kernel-janitors, linux-nvme

What are th other 29 patches doing in this series?  Due to the lack of
context individual patches from series have to through /dev/null here,
sorry.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
  2022-11-02  6:47   ` Christoph Hellwig
@ 2022-11-02  6:57     ` Christophe JAILLET
  2022-11-02  6:58       ` Christoph Hellwig
  2022-11-02  7:05       ` Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-11-02  6:57 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Jens Axboe, Sagi Grimberg, Chaitanya Kulkarni,
	linux-kernel, kernel-janitors, linux-nvme

Le 02/11/2022 à 07:47, Christoph Hellwig a écrit :
> What are th other 29 patches doing in this series?  Due to the lack of
> context individual patches from series have to through /dev/null here,
> sorry.
> 

Hi,

in each patch, in order to give some context, I wrote:
    ---
    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/


What is the best strategy for sending such patches?

Should I send only individual patches?
Should everybody be in copy of all patches? Or at least of the cover letter?


Some patches have already been Acked or even applied. So I'll wait a bit 
so that things stabilize before resending what is remaining.

CJ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
  2022-11-02  6:57     ` Christophe JAILLET
@ 2022-11-02  6:58       ` Christoph Hellwig
  2022-11-02  7:05       ` Julia Lawall
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2022-11-02  6:58 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Christoph Hellwig, Keith Busch, Jens Axboe, Sagi Grimberg,
	Chaitanya Kulkarni, linux-kernel, kernel-janitors, linux-nvme

On Wed, Nov 02, 2022 at 07:57:23AM +0100, Christophe JAILLET wrote:
> What is the best strategy for sending such patches?

Just send them per subsystems as mini series or individual patches.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool()
  2022-11-02  6:57     ` Christophe JAILLET
  2022-11-02  6:58       ` Christoph Hellwig
@ 2022-11-02  7:05       ` Julia Lawall
  1 sibling, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2022-11-02  7:05 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Christoph Hellwig, Keith Busch, Jens Axboe, Sagi Grimberg,
	Chaitanya Kulkarni, linux-kernel, kernel-janitors, linux-nvme

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]



On Wed, 2 Nov 2022, Christophe JAILLET wrote:

> Le 02/11/2022 à 07:47, Christoph Hellwig a écrit :
> > What are th other 29 patches doing in this series?  Due to the lack of
> > context individual patches from series have to through /dev/null here,
> > sorry.
> >
>
> Hi,
>
> in each patch, in order to give some context, I wrote:
>    ---
>    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/
>
>
> What is the best strategy for sending such patches?

I send the cover letter to everyone.  The problem with sending individual
unconnected patches is that people who are looking at the patches on
generic mailing lists can't easily see that they should just skip over all
of them at once.  But it is hard to please everyone for this issue...

julia

>
> Should I send only individual patches?
> Should everybody be in copy of all patches? Or at least of the cover letter?
>
>
> Some patches have already been Acked or even applied. So I'll wait a bit so
> that things stabilize before resending what is remaining.
>
> CJ
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-02  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1667336095.git.christophe.jaillet@wanadoo.fr>
2022-11-01 21:13 ` [PATCH 06/30] nvme: Use kstrtobool() instead of strtobool() Christophe JAILLET
2022-11-02  5:52   ` Chaitanya Kulkarni
2022-11-02  6:47   ` Christoph Hellwig
2022-11-02  6:57     ` Christophe JAILLET
2022-11-02  6:58       ` Christoph Hellwig
2022-11-02  7:05       ` Julia Lawall

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 NNTP newsgroup(s).