Message ID | 20190607092232.83179-5-roger.pau@citrix.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | pci: expand usage of pci_sbdf_t | expand |
>>> On 07.06.19 at 11:22, <roger.pau@citrix.com> wrote: > And fix it's only caller. Fix? It wasn't broken, was it? How about "adjust"? > --- a/xen/include/xen/pci.h > +++ b/xen/include/xen/pci.h > @@ -34,7 +34,8 @@ > #define PCI_DEVFN2(bdf) ((bdf) & 0xff) > #define PCI_BDF(b,d,f) ((((b) & 0xff) << 8) | PCI_DEVFN(d,f)) > #define PCI_BDF2(b,df) ((((b) & 0xff) << 8) | ((df) & 0xff)) > -#define PCI_SBDF(s,b,d,f) ((((s) & 0xffff) << 16) | PCI_BDF(b,d,f)) > +#define PCI_SBDF(s,b,d,f) \ > + ((pci_sbdf_t) { .sbdf = (((s) & 0xffff) << 16) | PCI_BDF(b,d,f) }) Please can we gain the missing blanks after the commas here at this occasion (doable while committing)? Then Acked-by: Jan Beulich <jbeulich@suse.com> Jan
> From: Roger Pau Monne [mailto:roger.pau@citrix.com] > Sent: Friday, June 7, 2019 5:22 PM > > And fix it's only caller. > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > Reviewed-by: Paul Durrant <paul.durrant@citrix.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 9cc8623e53..59a46cd1c6 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -1115,7 +1115,8 @@ static int __init parse_rmrr_param(const char *str) /* Keep sbdf's even if they differ and later report an error. */ dev_count = user_rmrrs[nr_rmrr].dev_count; - user_rmrrs[nr_rmrr].sbdf[dev_count] = PCI_SBDF(seg, bus, dev, func); + user_rmrrs[nr_rmrr].sbdf[dev_count] = + PCI_SBDF(seg, bus, dev, func).sbdf; user_rmrrs[nr_rmrr].dev_count++; s = stmp; diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index b03927cd28..12f1cea19b 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -34,7 +34,8 @@ #define PCI_DEVFN2(bdf) ((bdf) & 0xff) #define PCI_BDF(b,d,f) ((((b) & 0xff) << 8) | PCI_DEVFN(d,f)) #define PCI_BDF2(b,df) ((((b) & 0xff) << 8) | ((df) & 0xff)) -#define PCI_SBDF(s,b,d,f) ((((s) & 0xffff) << 16) | PCI_BDF(b,d,f)) +#define PCI_SBDF(s,b,d,f) \ + ((pci_sbdf_t) { .sbdf = (((s) & 0xffff) << 16) | PCI_BDF(b,d,f) }) #define PCI_SBDF2(s,bdf) ((((s) & 0xffff) << 16) | ((bdf) & 0xffff)) #define PCI_SBDF3(s,b,df) ((((s) & 0xffff) << 16) | PCI_BDF2(b, df))