Skip to content

Commit

Permalink
xen: events: fix error checks in bind_*_to_irqhandler()
Browse files Browse the repository at this point in the history
Checking 'irq < 0' doesn't work when 'irq' is unsigned.

The assigned bind_evtchn_to_irq() and bind_virq_to_irq()
return int, so using int appears appropriate.

Signed-off-by: Nicolas Kaiser <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
  • Loading branch information
nikai3d authored and konradwilk committed Mar 30, 2011
1 parent 0ce790e commit 361ae8c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
unsigned long irqflags,
const char *devname, void *dev_id)
{
unsigned int irq;
int retval;
int irq, retval;

irq = bind_evtchn_to_irq(evtchn);
if (irq < 0)
Expand Down Expand Up @@ -955,8 +954,7 @@ int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
{
unsigned int irq;
int retval;
int irq, retval;

irq = bind_virq_to_irq(virq, cpu);
if (irq < 0)
Expand Down

0 comments on commit 361ae8c

Please sign in to comment.