[PATCH v2 08/18] pci: Fix use of flags in dm_pci_map_bar()

Andrew Scull ascull at google.com
Wed Apr 13 18:23:08 CEST 2022


> > diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> > index 33dda00002..8bbeb62f2e 100644
> > --- a/drivers/pci/pci-uclass.c
> > +++ b/drivers/pci/pci-uclass.c
> > @@ -1533,8 +1533,8 @@ static phys_addr_t dm_pci_map_ea_virt(struct udevice *dev, int ea_off,
> >         return addr;
> >  }
> >
> > -static void *dm_pci_map_ea_bar(struct udevice *dev, int bar, int flags,
> > -                              int ea_off, struct pci_child_plat *pdata)
> > +static void *dm_pci_map_ea_bar(struct udevice *dev, int bar, int ea_off,
> > +                              struct pci_child_plat *pdata)
> >  {
> >         int ea_cnt, i, entry_size;
> >         int bar_id = (bar - PCI_BASE_ADDRESS_0) >> 2;
> > @@ -1577,13 +1577,13 @@ static void *dm_pci_map_ea_bar(struct udevice *dev, int bar, int flags,
> >                         addr += dm_pci_map_ea_virt(dev, ea_off, pdata);
> >
> >                 /* size ignored for now */
> > -               return map_physmem(addr, 0, flags);
> > +               return map_physmem(addr, 0, MAP_NOCACHE);
> >         }
> >
> >         return 0;
> >  }
> >
> > -void *dm_pci_map_bar(struct udevice *dev, int bar, int flags)
> > +void *dm_pci_map_bar(struct udevice *dev, int bar, unsigned long flags)
>
> Why is this change (int => unsigned long) necessary?

The flags are used with pci_region::flags which is an unsigned long
and it seemed sensible to use the same type, size and sign, to avoid
anything unexpected.


More information about the U-Boot mailing list