linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 11303/14422] include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration
@ 2023-10-23 13:53 kernel test robot
  2023-10-23 16:14 ` Joao Martins
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-10-23 13:53 UTC (permalink / raw)
  To: Joao Martins
  Cc: oe-kbuild-all, Linux Memory Management List, Jason Gunthorpe,
	Lu Baolu, Kevin Tian

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e8361b005d7c92997d12f2b85a9e4a525738bd9d
commit: 14207f68dddf152fd0b2916451a1f4702de886e4 [11303/14422] iommu: Add iommu_domain ops for dirty tracking
config: sparc64-randconfig-r002-20220915 (https://download.01.org/0day-ci/archive/20231023/202310232131.TOhkKzZa-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231023/202310232131.TOhkKzZa-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310232131.TOhkKzZa-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/iommu/io-pgtable.c:11:
>> include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration
     172 |                                     struct iommu_dirty_bitmap *dirty);
         |                                            ^~~~~~~~~~~~~~~~~~


vim +172 include/linux/io-pgtable.h

   149	
   150	/**
   151	 * struct io_pgtable_ops - Page table manipulation API for IOMMU drivers.
   152	 *
   153	 * @map_pages:    Map a physically contiguous range of pages of the same size.
   154	 * @unmap_pages:  Unmap a range of virtually contiguous pages of the same size.
   155	 * @iova_to_phys: Translate iova to physical address.
   156	 *
   157	 * These functions map directly onto the iommu_ops member functions with
   158	 * the same names.
   159	 */
   160	struct io_pgtable_ops {
   161		int (*map_pages)(struct io_pgtable_ops *ops, unsigned long iova,
   162				 phys_addr_t paddr, size_t pgsize, size_t pgcount,
   163				 int prot, gfp_t gfp, size_t *mapped);
   164		size_t (*unmap_pages)(struct io_pgtable_ops *ops, unsigned long iova,
   165				      size_t pgsize, size_t pgcount,
   166				      struct iommu_iotlb_gather *gather);
   167		phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
   168					    unsigned long iova);
   169		int (*read_and_clear_dirty)(struct io_pgtable_ops *ops,
   170					    unsigned long iova, size_t size,
   171					    unsigned long flags,
 > 172					    struct iommu_dirty_bitmap *dirty);
   173	};
   174	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [linux-next:master 11303/14422] include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration
  2023-10-23 13:53 [linux-next:master 11303/14422] include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration kernel test robot
@ 2023-10-23 16:14 ` Joao Martins
  0 siblings, 0 replies; 2+ messages in thread
From: Joao Martins @ 2023-10-23 16:14 UTC (permalink / raw)
  To: Jason Gunthorpe, Kevin Tian, Lu Baolu
  Cc: oe-kbuild-all, Linux Memory Management List, kernel test robot

On 23/10/2023 14:53, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   e8361b005d7c92997d12f2b85a9e4a525738bd9d
> commit: 14207f68dddf152fd0b2916451a1f4702de886e4 [11303/14422] iommu: Add iommu_domain ops for dirty tracking
> config: sparc64-randconfig-r002-20220915 (https://download.01.org/0day-ci/archive/20231023/202310232131.TOhkKzZa-lkp@intel.com/config)
> compiler: sparc64-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231023/202310232131.TOhkKzZa-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202310232131.TOhkKzZa-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    In file included from drivers/iommu/io-pgtable.c:11:
>>> include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration
>      172 |                                     struct iommu_dirty_bitmap *dirty);
>          |                                            ^~~~~~~~~~~~~~~~~~
> 
> 
> vim +172 include/linux/io-pgtable.h

'Interesting' randconfig where we build sparc64 with ARM io-pgtable code (also
with IOMMU_API not set but with IOMMU_SUPPORT=y). I have fixed the warning as
below in the ifdef clause for !IOMMU_API following the rest of the style of the
header:

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9379ceefa5da..291b663c6c05 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -802,6 +802,8 @@ struct iommu_fwspec {};
 struct iommu_device {};
 struct iommu_fault_param {};
 struct iommu_iotlb_gather {};
+struct iommu_dirty_bitmap {};
+struct iommu_dirty_ops {};

 static inline bool iommu_present(const struct bus_type *bus)
 {
@@ -1034,6 +1036,18 @@ static inline bool iommu_iotlb_gather_queued(struct
iommu_iotlb_gather *gather)
        return false;
 }

+static inline void iommu_dirty_bitmap_init(struct iommu_dirty_bitmap *dirty,
+                                          struct iova_bitmap *bitmap,
+                                          struct iommu_iotlb_gather *gather)
+{
+}
+
+static inline void iommu_dirty_bitmap_record(struct iommu_dirty_bitmap *dirty,
+                                            unsigned long iova,
+                                            unsigned long length)
+{
+}
+
 static inline void iommu_device_unregister(struct iommu_device *iommu)
 {
 }


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

end of thread, other threads:[~2023-10-23 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23 13:53 [linux-next:master 11303/14422] include/linux/io-pgtable.h:172:44: warning: 'struct iommu_dirty_bitmap' declared inside parameter list will not be visible outside of this definition or declaration kernel test robot
2023-10-23 16:14 ` Joao Martins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox