lkml.org 
[lkml]   [2021]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 2/2] drivers/perf: hisi: Add driver for HiSilicon PCIe PMU
On Sat, Jun 12, 2021 at 01:33:55AM +0200, Krzysztof Wilczyński wrote:

> > +static ssize_t hisi_pcie_bus_show(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct hisi_pcie_pmu *pcie_pmu = to_pcie_pmu(dev_get_drvdata(dev));
> > +
> > + return sysfs_emit(buf, "0x%02x\n", PCI_BUS_NUM(pcie_pmu->bdf_min));
> > +}
>
> Same as above, what about "%#02x"?

I think you'd need "%#04x" because the field width includes the
leading "0x", so printing 1 with "%#02x" would result in "0x1" instead
of "0x01".

\
 
 \ /
  Last update: 2021-06-16 16:15    [W:0.113 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site