linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device
@ 2022-08-01 16:47 Andy Shevchenko
  2022-08-23 14:08 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-08-01 16:47 UTC (permalink / raw)
  To: Joerg Roedel, Lu Baolu, iommu, linux-kernel
  Cc: Joerg Roedel, Will Deacon, Robin Murphy, Andy Shevchenko

In order to make the underneath API easier to change in the future,
prevent users from dereferencing fwnode from struct device.
Instead, use the specific dev_fwnode() API for that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iommu/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 780fb7071577..31b5f4ceb2e9 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -173,7 +173,7 @@ int iommu_device_register(struct iommu_device *iommu,
 
 	iommu->ops = ops;
 	if (hwdev)
-		iommu->fwnode = hwdev->fwnode;
+		iommu->fwnode = dev_fwnode(hwdev);
 
 	spin_lock(&iommu_device_lock);
 	list_add_tail(&iommu->list, &iommu_device_list);
-- 
2.35.1


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

* Re: [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device
  2022-08-01 16:47 [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device Andy Shevchenko
@ 2022-08-23 14:08 ` Andy Shevchenko
  2022-08-23 15:12 ` Robin Murphy
  2022-09-07  8:37 ` Joerg Roedel
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-08-23 14:08 UTC (permalink / raw)
  To: Joerg Roedel, Lu Baolu, iommu, linux-kernel
  Cc: Joerg Roedel, Will Deacon, Robin Murphy

On Mon, Aug 01, 2022 at 07:47:58PM +0300, Andy Shevchenko wrote:
> In order to make the underneath API easier to change in the future,
> prevent users from dereferencing fwnode from struct device.
> Instead, use the specific dev_fwnode() API for that.

Any news?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device
  2022-08-01 16:47 [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device Andy Shevchenko
  2022-08-23 14:08 ` Andy Shevchenko
@ 2022-08-23 15:12 ` Robin Murphy
  2022-09-07  8:37 ` Joerg Roedel
  2 siblings, 0 replies; 4+ messages in thread
From: Robin Murphy @ 2022-08-23 15:12 UTC (permalink / raw)
  To: Andy Shevchenko, Joerg Roedel, Lu Baolu, iommu, linux-kernel
  Cc: Joerg Roedel, Will Deacon

On 01/08/2022 5:47 pm, Andy Shevchenko wrote:
> In order to make the underneath API easier to change in the future,
> prevent users from dereferencing fwnode from struct device.
> Instead, use the specific dev_fwnode() API for that.

Seems fair,

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

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/iommu/iommu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 780fb7071577..31b5f4ceb2e9 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -173,7 +173,7 @@ int iommu_device_register(struct iommu_device *iommu,
>   
>   	iommu->ops = ops;
>   	if (hwdev)
> -		iommu->fwnode = hwdev->fwnode;
> +		iommu->fwnode = dev_fwnode(hwdev);
>   
>   	spin_lock(&iommu_device_lock);
>   	list_add_tail(&iommu->list, &iommu_device_list);

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

* Re: [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device
  2022-08-01 16:47 [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device Andy Shevchenko
  2022-08-23 14:08 ` Andy Shevchenko
  2022-08-23 15:12 ` Robin Murphy
@ 2022-09-07  8:37 ` Joerg Roedel
  2 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2022-09-07  8:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Joerg Roedel, Lu Baolu, iommu, linux-kernel, Will Deacon, Robin Murphy

On Mon, Aug 01, 2022 at 07:47:58PM +0300, Andy Shevchenko wrote:
>  drivers/iommu/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

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

end of thread, other threads:[~2022-09-07  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 16:47 [PATCH v1 1/1] iommu: Do not dereference fwnode in struct device Andy Shevchenko
2022-08-23 14:08 ` Andy Shevchenko
2022-08-23 15:12 ` Robin Murphy
2022-09-07  8:37 ` 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).