linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu: Fix some W=1 warnings
@ 2022-01-28 10:44 John Garry
  2022-01-28 16:36 ` Robin Murphy
  2022-01-31 15:50 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2022-01-28 10:44 UTC (permalink / raw)
  To: joro, will, robin.murphy; +Cc: iommu, linux-kernel, John Garry

The code is mostly free of W=1 warning, so fix the following:

drivers/iommu/iommu.c:996: warning: expecting prototype for iommu_group_for_each_dev(). Prototype was for __iommu_group_for_each_dev() instead
drivers/iommu/iommu.c:3048: warning: Function parameter or member 'drvdata' not described in 'iommu_sva_bind_device'
drivers/iommu/ioasid.c:354: warning: Function parameter or member 'ioasid' not described in 'ioasid_get'
drivers/iommu/omap-iommu.c:1098: warning: expecting prototype for omap_iommu_suspend_prepare(). Prototype was for omap_iommu_prepare() instead

Signed-off-by: John Garry <john.garry@huawei.com>

diff --git a/drivers/iommu/ioasid.c b/drivers/iommu/ioasid.c
index 50ee27bbd04e..06fee7416816 100644
--- a/drivers/iommu/ioasid.c
+++ b/drivers/iommu/ioasid.c
@@ -349,6 +349,7 @@ EXPORT_SYMBOL_GPL(ioasid_alloc);
 
 /**
  * ioasid_get - obtain a reference to the IOASID
+ * @ioasid: the ID to get
  */
 void ioasid_get(ioasid_t ioasid)
 {
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 8b86406b7162..75741ce748d5 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -980,17 +980,6 @@ static int iommu_group_device_count(struct iommu_group *group)
 	return ret;
 }
 
-/**
- * iommu_group_for_each_dev - iterate over each device in the group
- * @group: the group
- * @data: caller opaque data to be passed to callback function
- * @fn: caller supplied callback function
- *
- * This function is called by group users to iterate over group devices.
- * Callers should hold a reference count to the group during callback.
- * The group->mutex is held across callbacks, which will block calls to
- * iommu_group_add/remove_device.
- */
 static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
 				      int (*fn)(struct device *, void *))
 {
@@ -1005,7 +994,17 @@ static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
 	return ret;
 }
 
-
+/**
+ * iommu_group_for_each_dev - iterate over each device in the group
+ * @group: the group
+ * @data: caller opaque data to be passed to callback function
+ * @fn: caller supplied callback function
+ *
+ * This function is called by group users to iterate over group devices.
+ * Callers should hold a reference count to the group during callback.
+ * The group->mutex is held across callbacks, which will block calls to
+ * iommu_group_add/remove_device.
+ */
 int iommu_group_for_each_dev(struct iommu_group *group, void *data,
 			     int (*fn)(struct device *, void *))
 {
@@ -3032,6 +3031,7 @@ EXPORT_SYMBOL_GPL(iommu_aux_get_pasid);
  * iommu_sva_bind_device() - Bind a process address space to a device
  * @dev: the device
  * @mm: the mm to bind, caller must hold a reference to it
+ * @drvdata: opaque data pointer to pass to bind callback
  *
  * Create a bond between device and address space, allowing the device to access
  * the mm using the returned PASID. If a bond already exists between @device and
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 91749654fd49..980e4af3f06b 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1085,7 +1085,7 @@ static __maybe_unused int omap_iommu_runtime_resume(struct device *dev)
 }
 
 /**
- * omap_iommu_suspend_prepare - prepare() dev_pm_ops implementation
+ * omap_iommu_prepare - prepare() dev_pm_ops implementation
  * @dev:	iommu device
  *
  * This function performs the necessary checks to determine if the IOMMU
-- 
2.26.2


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

* Re: [PATCH] iommu: Fix some W=1 warnings
  2022-01-28 10:44 [PATCH] iommu: Fix some W=1 warnings John Garry
@ 2022-01-28 16:36 ` Robin Murphy
  2022-01-31 15:50 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Robin Murphy @ 2022-01-28 16:36 UTC (permalink / raw)
  To: John Garry, joro, will; +Cc: iommu, linux-kernel

On 2022-01-28 10:44, John Garry wrote:
> The code is mostly free of W=1 warning, so fix the following:
> 
> drivers/iommu/iommu.c:996: warning: expecting prototype for iommu_group_for_each_dev(). Prototype was for __iommu_group_for_each_dev() instead
> drivers/iommu/iommu.c:3048: warning: Function parameter or member 'drvdata' not described in 'iommu_sva_bind_device'
> drivers/iommu/ioasid.c:354: warning: Function parameter or member 'ioasid' not described in 'ioasid_get'
> drivers/iommu/omap-iommu.c:1098: warning: expecting prototype for omap_iommu_suspend_prepare(). Prototype was for omap_iommu_prepare() instead

Certainly no harm in keeping the documentation up to date!

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: John Garry <john.garry@huawei.com>
> 
> diff --git a/drivers/iommu/ioasid.c b/drivers/iommu/ioasid.c
> index 50ee27bbd04e..06fee7416816 100644
> --- a/drivers/iommu/ioasid.c
> +++ b/drivers/iommu/ioasid.c
> @@ -349,6 +349,7 @@ EXPORT_SYMBOL_GPL(ioasid_alloc);
>   
>   /**
>    * ioasid_get - obtain a reference to the IOASID
> + * @ioasid: the ID to get
>    */
>   void ioasid_get(ioasid_t ioasid)
>   {
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 8b86406b7162..75741ce748d5 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -980,17 +980,6 @@ static int iommu_group_device_count(struct iommu_group *group)
>   	return ret;
>   }
>   
> -/**
> - * iommu_group_for_each_dev - iterate over each device in the group
> - * @group: the group
> - * @data: caller opaque data to be passed to callback function
> - * @fn: caller supplied callback function
> - *
> - * This function is called by group users to iterate over group devices.
> - * Callers should hold a reference count to the group during callback.
> - * The group->mutex is held across callbacks, which will block calls to
> - * iommu_group_add/remove_device.
> - */
>   static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
>   				      int (*fn)(struct device *, void *))
>   {
> @@ -1005,7 +994,17 @@ static int __iommu_group_for_each_dev(struct iommu_group *group, void *data,
>   	return ret;
>   }
>   
> -
> +/**
> + * iommu_group_for_each_dev - iterate over each device in the group
> + * @group: the group
> + * @data: caller opaque data to be passed to callback function
> + * @fn: caller supplied callback function
> + *
> + * This function is called by group users to iterate over group devices.
> + * Callers should hold a reference count to the group during callback.
> + * The group->mutex is held across callbacks, which will block calls to
> + * iommu_group_add/remove_device.
> + */
>   int iommu_group_for_each_dev(struct iommu_group *group, void *data,
>   			     int (*fn)(struct device *, void *))
>   {
> @@ -3032,6 +3031,7 @@ EXPORT_SYMBOL_GPL(iommu_aux_get_pasid);
>    * iommu_sva_bind_device() - Bind a process address space to a device
>    * @dev: the device
>    * @mm: the mm to bind, caller must hold a reference to it
> + * @drvdata: opaque data pointer to pass to bind callback
>    *
>    * Create a bond between device and address space, allowing the device to access
>    * the mm using the returned PASID. If a bond already exists between @device and
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index 91749654fd49..980e4af3f06b 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -1085,7 +1085,7 @@ static __maybe_unused int omap_iommu_runtime_resume(struct device *dev)
>   }
>   
>   /**
> - * omap_iommu_suspend_prepare - prepare() dev_pm_ops implementation
> + * omap_iommu_prepare - prepare() dev_pm_ops implementation
>    * @dev:	iommu device
>    *
>    * This function performs the necessary checks to determine if the IOMMU

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

* Re: [PATCH] iommu: Fix some W=1 warnings
  2022-01-28 10:44 [PATCH] iommu: Fix some W=1 warnings John Garry
  2022-01-28 16:36 ` Robin Murphy
@ 2022-01-31 15:50 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2022-01-31 15:50 UTC (permalink / raw)
  To: John Garry; +Cc: will, robin.murphy, iommu, linux-kernel

On Fri, Jan 28, 2022 at 06:44:33PM +0800, John Garry wrote:
> The code is mostly free of W=1 warning, so fix the following:
> 
> drivers/iommu/iommu.c:996: warning: expecting prototype for iommu_group_for_each_dev(). Prototype was for __iommu_group_for_each_dev() instead
> drivers/iommu/iommu.c:3048: warning: Function parameter or member 'drvdata' not described in 'iommu_sva_bind_device'
> drivers/iommu/ioasid.c:354: warning: Function parameter or member 'ioasid' not described in 'ioasid_get'
> drivers/iommu/omap-iommu.c:1098: warning: expecting prototype for omap_iommu_suspend_prepare(). Prototype was for omap_iommu_prepare() instead
> 
> Signed-off-by: John Garry <john.garry@huawei.com>

Applied, thanks.


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

end of thread, other threads:[~2022-01-31 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 10:44 [PATCH] iommu: Fix some W=1 warnings John Garry
2022-01-28 16:36 ` Robin Murphy
2022-01-31 15:50 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).