* [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect
@ 2025-01-03 16:58 Gao Shiyuan
2025-01-06 10:08 ` Vasant Hegde
2025-01-06 11:42 ` Joerg Roedel
0 siblings, 2 replies; 3+ messages in thread
From: Gao Shiyuan @ 2025-01-03 16:58 UTC (permalink / raw)
To: joro, suravee.suthikulpanit, will, robin.murphy,
christophe.jaillet
Cc: iommu, linux-kernel, gaoshiyuan
The return value of amd_iommu_detect is not used, so remove it and
is consistent with other iommu detect functions.
Signed-off-by: Gao Shiyuan <gaoshiyuan@baidu.com>
---
drivers/iommu/amd/init.c | 10 ++++------
include/linux/amd-iommu.h | 4 ++--
2 files changed, 6 insertions(+), 8 deletions(-)
v1 -> v2:
* Remove return; at the end of amd_iommu_detect
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 0e0a531042ac..bc419d3b7c1e 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3398,25 +3398,23 @@ static bool amd_iommu_sme_check(void)
* IOMMUs
*
****************************************************************************/
-int __init amd_iommu_detect(void)
+void __init amd_iommu_detect(void)
{
int ret;
if (no_iommu || (iommu_detected && !gart_iommu_aperture))
- return -ENODEV;
+ return;
if (!amd_iommu_sme_check())
- return -ENODEV;
+ return;
ret = iommu_go_to_state(IOMMU_IVRS_DETECTED);
if (ret)
- return ret;
+ return;
amd_iommu_detected = true;
iommu_detected = 1;
x86_init.iommu.iommu_init = amd_iommu_init;
-
- return 1;
}
/****************************************************************************
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
index 2b90c48a6a87..062fbd4c9b77 100644
--- a/include/linux/amd-iommu.h
+++ b/include/linux/amd-iommu.h
@@ -31,11 +31,11 @@ struct amd_iommu_pi_data {
struct task_struct;
struct pci_dev;
-extern int amd_iommu_detect(void);
+extern void amd_iommu_detect(void);
#else /* CONFIG_AMD_IOMMU */
-static inline int amd_iommu_detect(void) { return -ENODEV; }
+static inline void amd_iommu_detect(void) { }
#endif /* CONFIG_AMD_IOMMU */
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect
2025-01-03 16:58 [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect Gao Shiyuan
@ 2025-01-06 10:08 ` Vasant Hegde
2025-01-06 11:42 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Vasant Hegde @ 2025-01-06 10:08 UTC (permalink / raw)
To: Gao Shiyuan, joro, suravee.suthikulpanit, will, robin.murphy,
christophe.jaillet
Cc: iommu, linux-kernel
On 1/3/2025 10:28 PM, Gao Shiyuan wrote:
> The return value of amd_iommu_detect is not used, so remove it and
> is consistent with other iommu detect functions.
>
> Signed-off-by: Gao Shiyuan <gaoshiyuan@baidu.com>
Thanks for the fix.
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
-Vasant
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect
2025-01-03 16:58 [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect Gao Shiyuan
2025-01-06 10:08 ` Vasant Hegde
@ 2025-01-06 11:42 ` Joerg Roedel
1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2025-01-06 11:42 UTC (permalink / raw)
To: Gao Shiyuan
Cc: suravee.suthikulpanit, will, robin.murphy, christophe.jaillet,
iommu, linux-kernel
On Sat, Jan 04, 2025 at 12:58:08AM +0800, Gao Shiyuan wrote:
> The return value of amd_iommu_detect is not used, so remove it and
> is consistent with other iommu detect functions.
>
> Signed-off-by: Gao Shiyuan <gaoshiyuan@baidu.com>
> ---
> drivers/iommu/amd/init.c | 10 ++++------
> include/linux/amd-iommu.h | 4 ++--
> 2 files changed, 6 insertions(+), 8 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-06 11:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 16:58 [PATCH v2 1/1] iommu/amd: remove return value of amd_iommu_detect Gao Shiyuan
2025-01-06 10:08 ` Vasant Hegde
2025-01-06 11:42 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox