All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] iommu: Remove extra NULL check when call strtobool()
@ 2018-05-14 16:22 Andy Shevchenko
       [not found] ` <20180514162225.81914-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2018-05-14 16:22 UTC (permalink / raw)
  To: Joerg Roedel, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Andy Shevchenko

strtobool() does check for NULL parameter already. No need to repeat.

While here, switch to kstrtobool() and unshadow actual error code
(which is still -EINVAL).

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/iommu/iommu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index d2aa23202bb9..7f61b142263e 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -116,9 +116,11 @@ static void __iommu_detach_group(struct iommu_domain *domain,
 static int __init iommu_set_def_domain_type(char *str)
 {
 	bool pt;
+	int ret;
 
-	if (!str || strtobool(str, &pt))
-		return -EINVAL;
+	ret = kstrtobool(str, &pt);
+	if (ret)
+		return ret;
 
 	iommu_def_domain_type = pt ? IOMMU_DOMAIN_IDENTITY : IOMMU_DOMAIN_DMA;
 	return 0;
-- 
2.17.0

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

* Re: [PATCH v1] iommu: Remove extra NULL check when call strtobool()
       [not found] ` <20180514162225.81914-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2018-05-15 14:29   ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2018-05-15 14:29 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, May 14, 2018 at 07:22:25PM +0300, Andy Shevchenko wrote:
> strtobool() does check for NULL parameter already. No need to repeat.
> 
> While here, switch to kstrtobool() and unshadow actual error code
> (which is still -EINVAL).
> 
> No functional change intended.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

Applied, thanks.

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

end of thread, other threads:[~2018-05-15 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 16:22 [PATCH v1] iommu: Remove extra NULL check when call strtobool() Andy Shevchenko
     [not found] ` <20180514162225.81914-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2018-05-15 14:29   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.