From: Baolu Lu <baolu.lu@linux.intel.com>
To: Yanfei Xu <yanfei.xu@intel.com>,
dwmw2@infradead.org, joro@8bytes.org, will@kernel.org,
robin.murphy@arm.com
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iommu/vt-d: Remove the dead code in init_iommu_hw()
Date: Wed, 31 May 2023 11:24:32 +0800 [thread overview]
Message-ID: <3d7ce5c1-c248-a14a-2dc4-79449da9aa43@linux.intel.com> (raw)
In-Reply-To: <20230530092503.152926-2-yanfei.xu@intel.com>
On 5/30/23 5:25 PM, Yanfei Xu wrote:
> After 'commit 2a41ccee2fdc ("iommu/vt-d: Change
> iommu_enable/disable_translation to return void")', init_iommu_hw() only
> returns 0. If statement for return value of this function is meaningless.
> Hence change init_iommu_hw() to return viod and remove the dead code of
> if statement in init_iommu_hw()
>
> Signed-off-by: Yanfei Xu<yanfei.xu@intel.com>
> ---
> drivers/iommu/intel/iommu.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index 8096273b034c..e98f1b122b49 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -2963,7 +2963,7 @@ static void __init init_no_remapping_devices(void)
> }
>
> #ifdef CONFIG_SUSPEND
> -static int init_iommu_hw(void)
> +static void init_iommu_hw(void)
> {
> struct dmar_drhd_unit *drhd;
> struct intel_iommu *iommu = NULL;
> @@ -2988,8 +2988,6 @@ static int init_iommu_hw(void)
> iommu_enable_translation(iommu);
> iommu_disable_protect_mem_regions(iommu);
> }
> -
> - return 0;
2966 static int init_iommu_hw(void)
2967 {
2968 struct dmar_drhd_unit *drhd;
2969 struct intel_iommu *iommu = NULL;
2970
2971 for_each_active_iommu(iommu, drhd)
2972 if (iommu->qi)
2973 dmar_reenable_qi(iommu);
dmar_reenable_qi() still possibly returns an error number. It's better
to pass this error number to the caller of init_iommu_hw()?
2974
2975 for_each_iommu(iommu, drhd) {
2976 if (drhd->ignored) {
Best regards,
baolu
next prev parent reply other threads:[~2023-05-31 3:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 9:25 [PATCH 0/2] Misc cleanup for iommu/vt-d Yanfei Xu
2023-05-30 9:25 ` [PATCH 1/2] iommu/vt-d: Remove the dead code in init_iommu_hw() Yanfei Xu
2023-05-31 3:24 ` Baolu Lu [this message]
2023-05-31 6:55 ` Yanfei Xu
2023-06-01 1:15 ` Baolu Lu
2023-06-01 7:49 ` Yanfei Xu
2023-05-30 9:25 ` [PATCH 2/2] iommu/vt-d: Use BUG_ON to check NULL value of 'table' Yanfei Xu
2023-05-31 3:26 ` Baolu Lu
2023-05-31 7:09 ` Yanfei Xu
2023-06-01 1:23 ` Baolu Lu
2023-06-01 4:47 ` Yanfei Xu
2023-06-02 14:32 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d7ce5c1-c248-a14a-2dc4-79449da9aa43@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yanfei.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox