On Tue, Jul 20, 2021 at 01:50:08PM -0700, Nirmal Patel wrote: > +#define PCI_HEADER_TYPE_MASK 0x7f > +#define PCI_CLASS_BRIDGE_PCI 0x0604 Please use the existing definitions from pci_regs.h / pci_ids.h. > > +#define DEVICE_SPACE (8 * 4096) > +#define VMD_DEVICE_BASE(vmd, device) ((vmd)->cfgbar + (device) * DEVICE_SPACE) > +#define VMD_FUNCTION_BASE(vmd, device, fn) ((vmd)->cfgbar + (device) * (DEVICE_SPACE + (fn*4096))) Plase turn thos into readable inline functions and avoid the overly long lines. > + /* > + * Subdevice config space may or many not be mapped linearly using 4k config > + * space. > + */ Please avoid the overly long line, especially in a comment.