public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>
Cc: baolu.lu@linux.intel.com, kernel@collabora.com,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/vt-d: remove unneeded validity check on dev
Date: Tue, 5 Apr 2022 09:38:05 +0800	[thread overview]
Message-ID: <806562e6-04b0-9ad9-e3cc-45e0bc12335e@linux.intel.com> (raw)
In-Reply-To: <ace47a96-4e43-697a-4cfe-04544f014940@collabora.com>

On 2022/4/4 15:52, Muhammad Usama Anjum wrote:
> Any thoughts?

It looks good to me. I will queue it for v5.19.

Best regards,
baolu

> 
> On 3/13/22 8:03 PM, Muhammad Usama Anjum wrote:
>> dev_iommu_priv_get() is being used at the top of this function which
>> dereferences dev. Dev cannot be NULL after this. Remove the validity
>> check on dev and simplify the code.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>>   drivers/iommu/intel/iommu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index df5c62ecf942b..f79edbbd651a4 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -2502,7 +2502,7 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
>>   		}
>>   	}
>>   
>> -	if (dev && domain_context_mapping(domain, dev)) {
>> +	if (domain_context_mapping(domain, dev)) {
>>   		dev_err(dev, "Domain context map failed\n");
>>   		dmar_remove_one_dev_info(dev);
>>   		return NULL;
> 

      reply	other threads:[~2022-04-05  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 15:03 [PATCH] iommu/vt-d: remove unneeded validity check on dev Muhammad Usama Anjum
2022-04-04  7:52 ` Muhammad Usama Anjum
2022-04-05  1:38   ` Lu Baolu [this message]

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=806562e6-04b0-9ad9-e3cc-45e0bc12335e@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=usama.anjum@collabora.com \
    --cc=will@kernel.org \
    /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