Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636774 > unrolled thread

[PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions

Started byManoj Iyer <manoj.iyer@canonical.com>
First post2017-05-06 00:40 +0200
Last post2017-05-08 00:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions Manoj Iyer <manoj.iyer@canonical.com> - 2017-05-06 00:40 +0200
    Re: [PATCH] iommu: Fix incompatible arg type passed to  iommu_get/put_resv_regions kbuild test robot <lkp@intel.com> - 2017-05-08 00:30 +0200

#1636774 — [PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions

FromManoj Iyer <manoj.iyer@canonical.com>
Date2017-05-06 00:40 +0200
Subject[PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions
Message-ID<tDU3f-7VT-11@gated-at.bofh.it>
Argument to iommu_get/put_resv_regions function in
iommu_get_group_resv_regions function expects a struct device *
as first argument, struct device is passed instead.

Commit 39ab9555c241 ("iommu: Add sysfs bindings for struct iommu_device")
in linux-next adds struct device dev to struct iommu_device instead of
struct device * but the code in drivers/iommu/iommu.c was not refactored
to take this change into account.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
 drivers/iommu/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index cf7ca7e70777..d9f585160c0b 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -259,9 +259,9 @@ int iommu_get_group_resv_regions(struct iommu_group *group,
 		struct list_head dev_resv_regions;
 
 		INIT_LIST_HEAD(&dev_resv_regions);
-		iommu_get_resv_regions(device->dev, &dev_resv_regions);
+		iommu_get_resv_regions(&device->dev, &dev_resv_regions);
 		ret = iommu_insert_device_resv_regions(&dev_resv_regions, head);
-		iommu_put_resv_regions(device->dev, &dev_resv_regions);
+		iommu_put_resv_regions(&device->dev, &dev_resv_regions);
 		if (ret)
 			break;
 	}
-- 
2.11.0

[toc] | [next] | [standalone]


#1637110 — Re: [PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions

Fromkbuild test robot <lkp@intel.com>
Date2017-05-08 00:30 +0200
SubjectRe: [PATCH] iommu: Fix incompatible arg type passed to iommu_get/put_resv_regions
Message-ID<tECQG-3x1-11@gated-at.bofh.it>
In reply to#1636774

[Multipart message — attachments visible in raw view] — view raw

Hi Manoj,

[auto build test ERROR on iommu/next]
[also build test ERROR on v4.11 next-20170505]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Manoj-Iyer/iommu-Fix-incompatible-arg-type-passed-to-iommu_get-put_resv_regions/20170507-153552
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: x86_64-kexec (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/iommu/iommu.c: In function 'iommu_get_group_resv_regions':
>> drivers/iommu/iommu.c:262:26: error: passing argument 1 of 'iommu_get_resv_regions' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iommu_get_resv_regions(&device->dev, &dev_resv_regions);
                             ^
   In file included from drivers/iommu/iommu.c:28:0:
   include/linux/iommu.h:297:13: note: expected 'struct device *' but argument is of type 'struct device **'
    extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
                ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/iommu/iommu.c:264:26: error: passing argument 1 of 'iommu_put_resv_regions' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iommu_put_resv_regions(&device->dev, &dev_resv_regions);
                             ^
   In file included from drivers/iommu/iommu.c:28:0:
   include/linux/iommu.h:298:13: note: expected 'struct device *' but argument is of type 'struct device **'
    extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
                ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/iommu_get_resv_regions +262 drivers/iommu/iommu.c

   256	
   257		mutex_lock(&group->mutex);
   258		list_for_each_entry(device, &group->devices, list) {
   259			struct list_head dev_resv_regions;
   260	
   261			INIT_LIST_HEAD(&dev_resv_regions);
 > 262			iommu_get_resv_regions(&device->dev, &dev_resv_regions);
   263			ret = iommu_insert_device_resv_regions(&dev_resv_regions, head);
 > 264			iommu_put_resv_regions(&device->dev, &dev_resv_regions);
   265			if (ret)
   266				break;
   267		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web