[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210616141447.GA2973335@bjorn-Precision-5520>
Date: Wed, 16 Jun 2021 09:14:47 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Krzysztof Wilczyński <kw@...ux.com>
Cc: Qi Liu <liuqi115@...wei.com>, will@...nel.org,
mark.rutland@....com, bhelgaas@...gle.com,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linuxarm@...wei.com,
zhangshaokun@...ilicon.com
Subject: Re: [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".
Powered by blists - more mailing lists