lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <51DE1A35.2030108@huawei.com>
Date:	Thu, 11 Jul 2013 10:36:37 +0800
From:	Yijing Wang <wangyijing@...wei.com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Rafael <rjw@...k.pl>, Hanjun Guo <guohanjun@...wei.com>,
	Jiang Liu <jiang.liu@...wei.com>,
	Oliver Neukum <oneukum@...e.de>,
	Paul Bolle <pebolle@...cali.nl>,
	Gu Zheng <guz.fnst@...fujitsu.com>
Subject: Re: [PATCH 1/2] PCI: introduce PCIe Device Serial NUmber Capability
 support

>> + */
>> +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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ