mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yuan Can <yuancan@huawei.com>
To: Robin Murphy <robin.murphy@arm.com>, <joro@8bytes.org>,
	<will@kernel.org>, <iommu@lists.linux.dev>
Cc: <linux-kernel@vger.kernel.org>, <baolu.lu@linux.intel.com>,
	<haifeng.zhao@linux.intel.com>
Subject: Re: [PATCH] iommu: use iommu_group_ref_get to hold group reference
Date: Tue, 30 Aug 2022 20:57:58 +0800	[thread overview]
Message-ID: <2501c884-7c78-d367-3463-5b86d302da89@huawei.com> (raw)
In-Reply-To: <5f47c5b7-534d-5714-1f91-04005ada8b8f@arm.com>


在 2022/8/30 17:32, Robin Murphy 写道:
> On 2022-08-26 03:40, Yuan Can wrote:
>> Replace kobject_get with iommu_group_ref_get for better
>> readability.
>
> I disagree, sorry. iommu_group_ref_get() is meant as a helper for 
> drivers, and the core code uses the raw kobject internally everywhere 
> else, including several other times within this function. Especially 
> the raw kobject_put() in the cleanup path - in terms of readability 
> I'd say it's actively harmful to obfuscate what that pairs with.
>
> Thanks,
> Robin.

Understood, thanks for your reply.

Best regards,

Yuan Can

>
>> Signed-off-by: Yuan Can <yuancan@huawei.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..8e7f30f7188c 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -903,7 +903,7 @@ int iommu_group_add_device(struct iommu_group 
>> *group, struct device *dev)
>>           goto err_free_name;
>>       }
>>   -    kobject_get(group->devices_kobj);
>> +    iommu_group_ref_get(group);
>>         dev->iommu_group = group;
>

      reply	other threads:[~2022-08-30 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  2:40 Yuan Can
2022-08-30  9:32 ` Robin Murphy
2022-08-30 12:57   ` Yuan Can [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=2501c884-7c78-d367-3463-5b86d302da89@huawei.com \
    --to=yuancan@huawei.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.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

all inboxes | Powered by JetHome®