All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Rafael <rjw@sisk.pl>, Hanjun Guo <guohanjun@huawei.com>,
	Jiang Liu <jiang.liu@huawei.com>, Oliver Neukum <oneukum@suse.de>,
	Paul Bolle <pebolle@tiscali.nl>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>
Subject: Re: [PATCH 1/2] PCI: introduce PCIe Device Serial NUmber Capability support
Date: Thu, 11 Jul 2013 10:36:37 +0800	[thread overview]
Message-ID: <51DE1A35.2030108@huawei.com> (raw)
In-Reply-To: <CAErSpo6L8W40JBjNfE+bf_HWaW5be0VLdK+YyN3+J+05--ukyA@mail.gmail.com>

>> + */
>> +void pci_get_dsn(struct pci_dev *dev, u64 *sn)
> 
> How about:
> 
>     u64 pci_device_serial_number(struct pci_dev *dev)
> 
> "get" suggests reference counting, which isn't happening here.  And
> why pass a pointer to a return value when we can just as easily return
> it directly?

Yes, u64 pci_device_serial_number(struct pci_dev *dev) is better, thanks!

> 
id pci_init_capabilities(struct pci_dev *dev)
>>         /* Power Management */
>>         pci_pm_init(dev);
>>
>> +       /* Device Serial Number */
>> +       pci_dsn_init(dev);
> 
>     dev->sn = pci_serial_number(dev);
> 
> Obvious, no comment or wrapper function needed.

OK, will remove the unnecessary comment.

> 
>> +
>>         /* Vital Product Data */
>>         pci_vpd_pci22_init(dev);


      reply	other threads:[~2013-07-11  2:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09  7:55 [PATCH 1/2] PCI: introduce PCIe Device Serial NUmber Capability support Yijing Wang
2013-07-09  8:09 ` Gu Zheng
2013-07-09  8:20   ` Yijing Wang
2013-07-10 21:57 ` Bjorn Helgaas
2013-07-11  2:36   ` Yijing Wang [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=51DE1A35.2030108@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=guohanjun@huawei.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=pebolle@tiscali.nl \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.