[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 2/2] tools/libxl: Switch irq to unsigned int
The PCI device irq is read with fscanf(%u). Switch the irq variable to unsigned int to match. Linux driver/pci/pci-sysfs.c:irq_show() uses %u to print the value. However, unsigned int irq doesn't compile because of: error: pointer targets in passing argument 4 of 'xc_physdev_map_pirq' differ in signedness [-Werror=pointer-sign] Add int pirq to provide the desired type instead of re-using irq. Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx> --- v2: New --- tools/libs/light/libxl_pci.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c index 6ddcdef6ad..a8460fb3ec 100644 --- a/tools/libs/light/libxl_pci.c +++ b/tools/libs/light/libxl_pci.c @@ -1420,8 +1420,8 @@ static void pci_add_dm_done(libxl__egc *egc, char *sysfs_path; FILE *f; unsigned long long start, end, flags, size; - int irq, i; - int r; + unsigned int irq; + int i, r; uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED; uint32_t domainid = domid; bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid); @@ -1499,7 +1499,9 @@ static void pci_add_dm_done(libxl__egc *egc, goto out_no_irq; } if (fscanf(f, "%u", &irq) == 1 && irq > 0 && irq < PCI_IRQ_LINE_LIMIT) { - r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq); + int pirq = irq; + + r = xc_physdev_map_pirq(ctx->xch, domid, irq, &pirq); if (r < 0) { LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)", irq, r); @@ -1507,10 +1509,10 @@ static void pci_add_dm_done(libxl__egc *egc, rc = ERROR_FAIL; goto out; } - r = xc_domain_irq_permission(ctx->xch, domid, irq, 1); + r = xc_domain_irq_permission(ctx->xch, domid, pirq, 1); if (r < 0) { LOGED(ERROR, domainid, - "xc_domain_irq_permission irq=%d (error=%d)", irq, r); + "xc_domain_irq_permission irq=%d (error=%d)", pirq, r); fclose(f); rc = ERROR_FAIL; goto out; @@ -2182,8 +2184,8 @@ static void pci_remove_detached(libxl__egc *egc, { STATE_AO_GC(prs->aodev->ao); libxl_ctx *ctx = libxl__gc_owner(gc); - unsigned int start = 0, end = 0, flags = 0, size = 0; - int irq = 0, i, stubdomid = 0; + unsigned int start = 0, end = 0, flags = 0, size = 0, irq = 0; + int i, stubdomid = 0; const char *sysfs_path; FILE *f; uint32_t domainid = prs->domid; -- 2.49.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |