Skip to content

Commit

Permalink
xen:events: move find_unbound_irq inside CONFIG_PCI_MSI
Browse files Browse the repository at this point in the history
The only caller is xen_allocate_pirq_msi which is also under this
ifdef so this fixes:
    drivers/xen/events.c:377: warning: 'find_unbound_pirq' defined but not used
when CONFIG_PCI_MSI=n

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
  • Loading branch information
Ian Campbell authored and Konrad Rzeszutek Wilk committed Mar 3, 2011
1 parent 3f2a230 commit cbf6aa8
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,23 +387,6 @@ static int get_nr_hw_irqs(void)
return ret;
}

static int find_unbound_pirq(int type)
{
int rc, i;
struct physdev_get_free_pirq op_get_free_pirq;
op_get_free_pirq.type = type;

rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq);
if (!rc)
return op_get_free_pirq.pirq;

for (i = 0; i < nr_irqs; i++) {
if (pirq_to_irq[i] < 0)
return i;
}
return -1;
}

static int find_unbound_irq(void)
{
struct irq_data *data;
Expand Down Expand Up @@ -677,6 +660,23 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name)
#include <linux/msi.h>
#include "../pci/msi.h"

static int find_unbound_pirq(int type)
{
int rc, i;
struct physdev_get_free_pirq op_get_free_pirq;
op_get_free_pirq.type = type;

rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq);
if (!rc)
return op_get_free_pirq.pirq;

for (i = 0; i < nr_irqs; i++) {
if (pirq_to_irq[i] < 0)
return i;
}
return -1;
}

void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc)
{
spin_lock(&irq_mapping_update_lock);
Expand Down

0 comments on commit cbf6aa8

Please sign in to comment.