Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/8/21 8:02 AM, Niklas Schnelle wrote:


On 3/7/21 9:46 PM, Krzysztof Wilczyński wrote:
Hi Niklas,

[...]
+static ssize_t index_show(struct device *dev,
+			  struct device_attribute *attr, char *buf)
+{
+	struct zpci_dev *zdev = to_zpci(to_pci_dev(dev));
+	u32 index = ~0;
+
+	if (zpci_unique_uid)
+		index = zdev->uid;
+
+	return sprintf(buf, "%u\n", index);
[...]

Would it be possible to use the new sysfs_emit() rather than sprintf()
even though the zpci_attr macro and still use mio_enabled_show() still
would use sprintf().  What do you think?

See https://www.kernel.org/doc/html/latest/filesystems/sysfs.html for
the changes in the internal API.

Krzysztof


Of course that makes sense and thanks for pointing me to this API!
@Viktor, may I carry your R-b over?

Sure, please go ahead.
I'll also update the other attributes in a clean up patch.

Thanks,
Niklas


--
Kind Regards,
   Viktor



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux