xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Roger Pau Monne" <roger.pau@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>, WeiLiu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Brian Woods <brian.woods@amd.com>
Subject: Re: [Xen-devel] [PATCH v3 13/13] print: introduce a format specifier for pci_sbdf_t
Date: Mon, 17 Jun 2019 09:10:47 -0600	[thread overview]
Message-ID: <5D07AD770200007800238D9E@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20190607092232.83179-14-roger.pau@citrix.com>

>>> On 07.06.19 at 11:22, <roger.pau@citrix.com> wrote:
> The new format specifier is '%pp', and prints a pci_sbdf_t using the
> seg:bus:dev.func format. Replace all SBDFs printed using
> '%04x:%02x:%02x.%u' to use the new format specifier.

Well, I continue to not be happy about the use of %p (rather than the
proposed %o) here. I don't suppose you've actually tried, and it didn't
work out?

> --- a/xen/common/vsprintf.c
> +++ b/xen/common/vsprintf.c
> @@ -394,6 +394,20 @@ static char *print_vcpu(char *str, const char *end, const struct vcpu *v)
>      return number(str + 1, end, v->vcpu_id, 10, -1, -1, 0);
>  }
>  
> +static char *print_pci_addr(char *str, const char *end, const pci_sbdf_t *sbdf)
> +{
> +    str = number(str, end, sbdf->seg, 16, 4, -1, ZEROPAD);
> +    if ( str < end )
> +        *str = ':';
> +    str = number(str + 1, end, sbdf->bus, 16, 2, -1, ZEROPAD);
> +    if ( str < end )
> +        *str = ':';
> +    str = number(str + 1, end, sbdf->dev, 16, 2, -1, ZEROPAD);
> +    if ( str < end )
> +        *str = '.';
> +    return number(str + 1, end, sbdf->fn, 8, -1, -1, 0);

Nit: Blank line above here please.

> +}
> +
>  static char *pointer(char *str, const char *end, const char **fmt_ptr,
>                       const void *arg, int field_width, int precision,
>                       int flags)
> @@ -476,6 +490,10 @@ static char *pointer(char *str, const char *end, const char **fmt_ptr,
>          }
>      }
>  
> +    case 'p': /* PCI SBDF. */

Another nit: The full stop would imo better be omitted here. I notice this
is inconsistent at present in this function, but generally I think it's better
to not have it when a comment is not really a sentence. The style
guidelines explicitly permit omitting it iirc.

> +        ++*fmt_ptr;
> +        return print_pci_addr(str, end, arg);
> +
>      case 's': /* Symbol name with offset and size (iff offset != 0) */
>      case 'S': /* Symbol name unconditionally with offset and size */
>      {

In principle I'd expect this to not even build on Arm, as pci_sbdf_t should
not be defined. I guess you did build test it and it worked, but I think the
additions should still go in #ifdef CONFIG_HAS_PCI.

Also I'd like to point out that again review and in particular collection of
acks might be easier if this got split up a little. But I'm not going to insist.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-06-17 15:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  9:22 [Xen-devel] [PATCH v3 00/13] pci: expand usage of pci_sbdf_t Roger Pau Monne
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 01/13] pci: rename func field to fn Roger Pau Monne
2019-06-07  9:25   ` Paul Durrant
2019-06-07 10:15   ` Jan Beulich
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 02/13] pci: introduce a devfn field to pci_sbdf_t Roger Pau Monne
2019-06-07 10:02   ` Paul Durrant
2019-06-07 10:16   ` Jan Beulich
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 03/13] pci: introduce a pci_sbdf_t field to pci_dev Roger Pau Monne
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 04/13] pci: make PCI_SBDF return a pci_sbdf_t Roger Pau Monne
2019-06-07 13:35   ` Jan Beulich
2019-06-28  1:59   ` Tian, Kevin
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 05/13] pci: make PCI_SBDF2 " Roger Pau Monne
2019-06-07 10:03   ` Paul Durrant
2019-06-07 13:36   ` Jan Beulich
2019-06-28  2:00   ` Tian, Kevin
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 06/13] pci: make PCI_SBDF3 " Roger Pau Monne
2019-06-07 13:39   ` Jan Beulich
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 07/13] pci: switch pci_conf_read8 to use pci_sbdf_t Roger Pau Monne
2019-06-13 14:20   ` Jan Beulich
2019-06-19 15:59   ` Woods, Brian
2019-06-28  2:01   ` Tian, Kevin
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 08/13] pci: switch pci_conf_read16 " Roger Pau Monne
2019-06-13 14:26   ` Jan Beulich
2019-06-19 16:00   ` Woods, Brian
2019-06-28  2:02   ` Tian, Kevin
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 09/13] pci: switch pci_conf_read32 " Roger Pau Monne
2019-06-13 14:36   ` Jan Beulich
2019-06-14  9:06     ` Roger Pau Monné
2019-06-14  9:20       ` Jan Beulich
2019-06-19 16:01   ` Woods, Brian
2019-06-28  2:03   ` Tian, Kevin
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 10/13] pci: switch pci_conf_write8 " Roger Pau Monne
2019-06-17  9:57   ` Jan Beulich
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 11/13] pci: switch pci_conf_write16 " Roger Pau Monne
2019-06-17 10:05   ` Jan Beulich
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 12/13] pci: switch pci_conf_write32 " Roger Pau Monne
2019-06-17 10:28   ` Jan Beulich
2019-06-19 16:01   ` Woods, Brian
2019-06-07  9:22 ` [Xen-devel] [PATCH v3 13/13] print: introduce a format specifier for pci_sbdf_t Roger Pau Monne
2019-06-17 15:10   ` Jan Beulich [this message]
2019-06-17 15:12     ` Andrew Cooper
2019-06-17 15:49       ` Jan Beulich
2019-06-19 16:02   ` Woods, Brian

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=5D07AD770200007800238D9E@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=brian.woods@amd.com \
    --cc=julien.grall@arm.com \
    --cc=kevin.tian@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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).