From: brookxu <brookxu.cn@gmail.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: jonathan.derrick@intel.com, lorenzo.pieralisi@arm.com,
robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] PCI: vmd: Assign a number to each VMD controller
Date: Fri, 17 Sep 2021 09:36:08 +0800 [thread overview]
Message-ID: <b87f7a38-d147-3da6-0352-ad2df7a5f55f@gmail.com> (raw)
In-Reply-To: <20210916225755.GA1511623@rocinante>
Krzysztof Wilczyński wrote on 2021/9/17 6:57 上午:
> Hi Xu,
>
> Thank you for sending the patch over!
>
> A small nitpick below, so feel free to ignore it.
>
> [...]
>> @@ -769,28 +773,48 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
>> {
>> unsigned long features = (unsigned long) id->driver_data;
>> struct vmd_dev *vmd;
>> - int err;
>> + int err = 0;
>>
>> - if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20))
>> - return -ENOMEM;
>> + if (resource_size(&dev->resource[VMD_CFGBAR]) < (1 << 20)) {
>> + err = -ENOMEM;
>> + goto out;
>> + }
>>
>> vmd = devm_kzalloc(&dev->dev, sizeof(*vmd), GFP_KERNEL);
>> - if (!vmd)
>> - return -ENOMEM;
>> + if (!vmd) {
>> + err = -ENOMEM;
>> + goto out;
>> + }
>
> I assume that you changed the above to use the newly added "out" label to
> be consistent given that you also have the other label, but since there is
> no clean-up to be done here, do we need this additional label?
>
>> vmd->dev = dev;
>> + vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL);
>> + if (vmd->instance < 0) {
>> + err = vmd->instance;
>> + goto out;
>> + }
>
> Similarly to here to the above, no clean-up to be done, and you could just
> return immediately here.
>
> What do you think?
>
Thanks, I think we can do this.
> Also, I think we might have lost a "Reviewed-by" from Jon Derrick somewhere
> along the way. Given that you only updated the commit log and the subject
> like, it probably still applies (unless Jon would like to give his seal of
> approval again).
>
Thanks, my mistake here.
> Krzysztof
>
prev parent reply other threads:[~2021-09-17 1:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 3:07 [PATCH v3] PCI: vmd: Assign a number to each VMD controller brookxu
2021-09-16 22:57 ` Krzysztof Wilczyński
2021-09-17 1:36 ` brookxu [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=b87f7a38-d147-3da6-0352-ad2df7a5f55f@gmail.com \
--to=brookxu.cn@gmail.com \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh@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;
as well as URLs for NNTP newsgroup(s).