linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Narendra K <narendra_k@dell.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Viktor Mihajlovski <mihajlov@linux.ibm.com>,
	Stefan Raspl <raspl@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [RFC 1/1] s390/pci: expose a PCI device's UID as its index
Date: Mon, 8 Mar 2021 08:02:07 +0100	[thread overview]
Message-ID: <c714ca55-7189-e196-7b8d-f02da555b399@linux.ibm.com> (raw)
In-Reply-To: <YEU7iFjxNxQK3ldc@rocinante>



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?

I'll also update the other attributes in a clean up patch.

Thanks,
Niklas

  reply	other threads:[~2021-03-08  7:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  9:52 [RFC 0/1] s390/pci: expose a PCI device's UID as its index Niklas Schnelle
2021-03-03  9:52 ` [RFC 1/1] " Niklas Schnelle
2021-03-07 20:46   ` Krzysztof Wilczyński
2021-03-08  7:02     ` Niklas Schnelle [this message]
2021-03-08  8:42       ` Viktor Mihajlovski

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=c714ca55-7189-e196-7b8d-f02da555b399@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mihajlov@linux.ibm.com \
    --cc=narendra_k@dell.com \
    --cc=oberpar@linux.ibm.com \
    --cc=raspl@linux.ibm.com \
    /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).