Message ID | 20190916202936.30403-1-christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | Accepted |
Commit | da6b05dce2a9c69880c3b9838938d5714703e80d |
Headers | show |
Series | iommu/qcom: Simplify a test in 'qcom_iommu_add_device()' | expand |
On Mon, Sep 16, 2019 at 10:29:36PM +0200, Christophe JAILLET wrote: > 'iommu_group_get_for_dev()' never returns NULL, so this test can be > simplified a bit. > It used to until commit 72dcac633475 ("iommu: Warn once when device_group callback returns NULL"). Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> regards, dan carpenter
On Mon, Sep 16, 2019 at 10:29:36PM +0200, Christophe JAILLET wrote: > 'iommu_group_get_for_dev()' never returns NULL, so this test can be > simplified a bit. > > This way, the test is consistent with all other calls to > 'iommu_group_get_for_dev()'. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > drivers/iommu/qcom_iommu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied, thanks.
diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c index c31e7bc4ccbe..3d99ec868892 100644 --- a/drivers/iommu/qcom_iommu.c +++ b/drivers/iommu/qcom_iommu.c @@ -539,8 +539,8 @@ static int qcom_iommu_add_device(struct device *dev) } group = iommu_group_get_for_dev(dev); - if (IS_ERR_OR_NULL(group)) - return PTR_ERR_OR_ZERO(group); + if (IS_ERR(group)) + return PTR_ERR(group); iommu_group_put(group); iommu_device_link(&qcom_iommu->iommu, dev);
'iommu_group_get_for_dev()' never returns NULL, so this test can be simplified a bit. This way, the test is consistent with all other calls to 'iommu_group_get_for_dev()'. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/iommu/qcom_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)