"pcifront-msi-x" :
"pcifront-msi",
DOMID_SELF);
- if (irq < 0) {
- ret = irq;
+ if (irq < 0)
goto free;
- }
i++;
}
kfree(v);
if (msg.data != XEN_PIRQ_MSI_DATA ||
xen_irq_from_pirq(pirq) < 0) {
pirq = xen_allocate_pirq_msi(dev, msidesc);
- if (pirq < 0) {
- irq = -ENODEV;
+ if (pirq < 0)
goto error;
- }
xen_msi_compose_msg(dev, pirq, &msg);
__write_msi_msg(msidesc, &msg);
dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq);
error:
dev_err(&dev->dev,
"Xen PCI frontend has not registered MSI/MSI-X support!\n");
- return irq;
+ return -ENODEV;
}
#ifdef CONFIG_XEN_DOM0
static void __init xen_init_cpuid_mask(void)
{
- unsigned int ax, bx, uninitialized_var(cx), dx;
+ unsigned int ax, bx, cx, dx;
unsigned int xsave_mask;
cpuid_leaf1_edx_mask =
static int p2m_dump_show(struct seq_file *m, void *v)
{
static const char * const level_name[] = { "top", "middle",
- "entry", "abnormal", NULL};
+ "entry", "abnormal" };
static const char * const type_name[] = { "identity", "missing",
- "pfn", "abnormal", NULL};
+ "pfn", "abnormal"};
#define TYPE_IDENTITY 0
#define TYPE_MISSING 1
#define TYPE_PFN 2
irq = irq_alloc_desc_from(first, -1);
- if (irq >= 0)
- xen_irq_init(irq);
+ xen_irq_init(irq);
return irq;
}
mutex_lock(&irq_mapping_update_lock);
irq = xen_allocate_irq_dynamic();
- if (irq < 0)
+ if (irq == -1)
goto out;
irq_set_chip_and_handler_name(irq, &xen_pirq_chip, handle_edge_irq,
error_irq:
mutex_unlock(&irq_mapping_update_lock);
xen_free_irq(irq);
- return ret;
+ return -1;
}
#endif
mutex_lock(&irq_mapping_update_lock);
list_for_each_entry(info, &xen_irq_list_head, list) {
- if (info->type != IRQT_PIRQ)
+ if (info == NULL || info->type != IRQT_PIRQ)
continue;
irq = info->irq;
if (info->u.pirq.pirq == pirq)
evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq),
GFP_KERNEL);
- if (!evtchn_to_irq)
- BUG();
for (i = 0; i < NR_EVENT_CHANNELS; i++)
evtchn_to_irq[i] = -1;
}
spin_unlock_irqrestore(&pcistub_devices_lock, flags);
- if (!found_psdev)
- return;
/*hold this lock for avoiding breaking link between
* pcistub and xen_pcibk when AER is in processing
char nodename[PCI_NODENAME_MAX];
if (!psdev) {
- printk(KERN_ERR DRV_NAME
- ":device is NULL when do AER recovery/kill_domain\n");
+ dev_err(&psdev->dev->dev,
+ "device is NULL when do AER recovery/kill_domain\n");
return;
}
if (err == 4)
return 0;
else if (err < 0)
- return err;
+ return -EINVAL;
/* try again without domain */
*domain = 0;
return -ENODEV;
xdev = to_xenbus_device(dev);
+ bus = container_of(xdev->dev.bus, struct xen_bus_type, bus);
if (xdev == NULL)
return -ENODEV;
- bus = container_of(xdev->dev.bus, struct xen_bus_type, bus);
-
if (add_uevent_var(env, "MODALIAS=xen-backend:%s", xdev->devicetype))
return -ENOMEM;