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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 7 Mar 2021 21:46:00 +0100
From:   Krzysztof WilczyƄski <kw@...ux.com>
To:     Niklas Schnelle <schnelle@...ux.ibm.com>
Cc:     Bjorn Helgaas <helgaas@...nel.org>,
        Narendra K <narendra_k@...l.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Viktor Mihajlovski <mihajlov@...ux.ibm.com>,
        Stefan Raspl <raspl@...ux.ibm.com>,
        Peter Oberparleiter <oberpar@...ux.ibm.com>,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org
Subject: Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ