Re: [Xen-devel] Fwd: BUG inlinux+v3.2.1/drivers/xen/xen-pciback/pci_stub.c

From: Jan Beulich
Date: Thu Jan 26 2012 - 04:16:18 EST


>>> On 25.01.12 at 22:22, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> wrote:
> --- a/drivers/xen/xen-pciback/xenbus.c
> +++ b/drivers/xen/xen-pciback/xenbus.c
> @@ -206,8 +206,9 @@ static int xen_pcibk_publish_pci_dev(struct
> xen_pcibk_device *pdev,
> goto out;
> }
>
> + /* TODO: implement feature-use-decimal-for-devfn */
> err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str,
> - "%04x:%02x:%02x.%02x", domain, bus,
> + "%04x:%02x:%02x.%1x", domain, bus,
> PCI_SLOT(devfn), PCI_FUNC(devfn));
>
> out:

If you are concerned about compatibility (as the added comment
suggests), then removing the leading zero is not an option either.

However, as long as all parsers of the string use plain %x or %d,
there's no issue here and you could as well use %d here too (as
PCI functions are always in the 0-7 range, which is identically
represented in octal [important for the case of a leading zero],
decimal, and hex).

Bottom line - just add the comment here, and leave the format
unchanged, or change the format to %d right away.

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/