diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-05-14 18:22:25 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2018-05-15 16:27:48 +0200 |
commit | 7f9584df8495787393d8c18598c2b6eb03e647b0 (patch) | |
tree | b44cf441f3d101bc1d9af1e6e887671e92f77552 /drivers/iommu | |
parent | iommu: Remove depends on HAS_DMA in case of platform dependency (diff) | |
download | linux-7f9584df8495787393d8c18598c2b6eb03e647b0.tar.xz linux-7f9584df8495787393d8c18598c2b6eb03e647b0.zip |
iommu: Remove extra NULL check when call strtobool()
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@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/iommu.c | 6 |
1 files 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; |