iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment
@ 2020-12-10  2:13 Adrian Huang
  2021-01-18 11:25 ` Will Deacon
  2021-01-27 11:31 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Adrian Huang @ 2020-12-10  2:13 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Adrian Huang, iommu, Will Deacon

From: Adrian Huang <ahuang12@lenovo.com>

From: Adrian Huang <ahuang12@lenovo.com>

The values of local variables are assigned after local variables
are declared, so no need to assign the initial value during the
variable declaration.

And, no need to assign NULL for the local variable 'ivrs_base'
after invoking acpi_put_table().

Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
---
 drivers/iommu/amd/init.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 23a790f8f550..103cbf8fc2d9 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -1916,7 +1916,7 @@ static void print_iommu_info(void)
 static int __init amd_iommu_init_pci(void)
 {
 	struct amd_iommu *iommu;
-	int ret = 0;
+	int ret;
 
 	for_each_iommu(iommu) {
 		ret = iommu_init_pci(iommu);
@@ -2555,8 +2555,8 @@ static void __init free_dma_resources(void)
 static int __init early_amd_iommu_init(void)
 {
 	struct acpi_table_header *ivrs_base;
+	int i, remap_cache_sz, ret;
 	acpi_status status;
-	int i, remap_cache_sz, ret = 0;
 	u32 pci_id;
 
 	if (!amd_iommu_detected)
@@ -2698,7 +2698,6 @@ static int __init early_amd_iommu_init(void)
 out:
 	/* Don't leak any ACPI memory */
 	acpi_put_table(ivrs_base);
-	ivrs_base = NULL;
 
 	return ret;
 }
-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment
  2020-12-10  2:13 [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment Adrian Huang
@ 2021-01-18 11:25 ` Will Deacon
  2021-01-27 11:31 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-01-18 11:25 UTC (permalink / raw)
  To: Adrian Huang; +Cc: Adrian Huang, iommu

On Thu, Dec 10, 2020 at 10:13:30AM +0800, Adrian Huang wrote:
> From: Adrian Huang <ahuang12@lenovo.com>
> 
> From: Adrian Huang <ahuang12@lenovo.com>
> 
> The values of local variables are assigned after local variables
> are declared, so no need to assign the initial value during the
> variable declaration.
> 
> And, no need to assign NULL for the local variable 'ivrs_base'
> after invoking acpi_put_table().
> 
> Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
> ---
>  drivers/iommu/amd/init.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment
  2020-12-10  2:13 [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment Adrian Huang
  2021-01-18 11:25 ` Will Deacon
@ 2021-01-27 11:31 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2021-01-27 11:31 UTC (permalink / raw)
  To: Adrian Huang; +Cc: Adrian Huang, iommu, Will Deacon

On Thu, Dec 10, 2020 at 10:13:30AM +0800, Adrian Huang wrote:
>  drivers/iommu/amd/init.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Applied, thanks.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2021-01-27 11:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10  2:13 [RESEND PATCH 1/1] iommu/amd: Remove unnecessary assignment Adrian Huang
2021-01-18 11:25 ` Will Deacon
2021-01-27 11:31 ` 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).