On Mon, Nov 28, 2016 at 12:32:00PM +0100, Alexander Gordeev wrote: > On Mon, Nov 28, 2016 at 06:05:01PM +0800, Peter Xu wrote: > > On Mon, Nov 28, 2016 at 10:53:39AM +0100, Alexander Gordeev wrote: > > > On Wed, Nov 23, 2016 at 06:57:20PM +0800, Peter Xu wrote: > > > > Please review. Thanks, > > > > > > Had to make the changes below to make it compile for aarch64/arm > > > (Did not check the validity though) > > > > > > diff --git a/lib/pci-host-generic.c b/lib/pci-host-generic.c > > > index 8bad8b12a466..958ef70a5922 100644 > > > --- a/lib/pci-host-generic.c > > > +++ b/lib/pci-host-generic.c > > > @@ -165,7 +165,7 @@ static struct pci_host_bridge *pci_dt_probe(void) > > > return host; > > > } > > > > > > -static bool pci_alloc_resource(pcidevaddr_t dev, int bar_num, u64 *addr) > > > +static bool pci_alloc_resource(struct pci_dev *dev, int bar_num, u64 *addr) > > > { > > > struct pci_host_bridge *host = pci_host_bridge; > > > struct pci_addr_space *as = &host->addr_space[0]; > > > @@ -192,7 +192,7 @@ static bool pci_alloc_resource(pcidevaddr_t dev, int bar_num, u64 *addr) > > > > > > if (i >= host->nr_addr_spaces) { > > > printf("%s: warning: can't satisfy request for ", __func__); > > > - pci_dev_print_id(dev); > > > + pci_dev_print_id(dev->bdf); > > > printf(" "); > > > pci_bar_print(dev, bar_num); > > > printf("\n"); > > > @@ -238,7 +238,7 @@ bool pci_probe(void) > > > for (i = 0; i < 6; i++) { > > > u64 addr; > > > > > > - if (pci_alloc_resource(dev, i, &addr)) { > > > + if (pci_alloc_resource(&pci_dev, i, &addr)) { > > > pci_bar_set_addr(&pci_dev, i, addr); > > > > > > if (pci_bar_is_memory(&pci_dev, i)) > > > > Hi, Alex, > > > > Thanks for helping verify this series against ARM. :-) (and sorry if I > > broke it :( ) > > > > However I may have missed the point here - could you please help paste > > the compile error message if without the above patch? I see that the > > patch changed interface for pci_alloc_resource(), but why the old one > > cannot work? > > aarch64-linux-gnu-gcc -std=gnu99 -ffreestanding -Wextra -O2 -I lib -I lib/libfdt -g -MMD -MF lib/.pci-host-generic.d -Wall -Werror -fomit-frame-pointer -Wno-frame-address -c -o lib/pci-host-generic.o lib/pci-host-generic.c > lib/pci-host-generic.c: In function ‘pci_alloc_resource’: > lib/pci-host-generic.c:178:2: error: passing argument 1 of ‘pci_bar_size’ makes pointer from integer without a cast [-Werror] > size = pci_bar_size(dev, bar_num); > ^ > In file included from lib/pci-host-generic.c:11:0: > lib/pci.h:45:20: note: expected ‘struct pci_dev *’ but argument is of type ‘pcidevaddr_t’ > extern phys_addr_t pci_bar_size(struct pci_dev *dev, int bar_num); > ^ > lib/pci-host-generic.c:182:2: error: passing argument 1 of ‘pci_bar_get’ makes pointer from integer without a cast [-Werror] > bar = pci_bar_get(dev, bar_num); > ^ > In file included from lib/pci-host-generic.c:11:0: > lib/pci.h:46:17: note: expected ‘struct pci_dev *’ but argument is of type ‘pcidevaddr_t’ > extern uint32_t pci_bar_get(struct pci_dev *dev, int bar_num); > ^ > lib/pci-host-generic.c:197:3: error: passing argument 1 of ‘pci_bar_print’ makes pointer from integer without a cast [-Werror] > pci_bar_print(dev, bar_num); > ^ > In file included from lib/pci-host-generic.c:11:0: > lib/pci.h:51:13: note: expected ‘struct pci_dev *’ but argument is of type ‘pcidevaddr_t’ > extern void pci_bar_print(struct pci_dev *dev, int bar_num); > ^ > lib/pci-host-generic.c: At top level: > cc1: error: unrecognized command line option "-Wno-frame-address" [-Werror] > cc1: all warnings being treated as errors > make: *** [lib/pci-host-generic.o] Error 1 Oops! Will repost with squashing your fix into patch 8/14. Thanks! -- peterx -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html