* [PATCH] xen: events: fix error checks in bind_*_to_irqhandler()
@ 2011-03-30 19:14 Nicolas Kaiser
2011-03-30 19:31 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Kaiser @ 2011-03-30 19:14 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Konrad Rzeszutek Wilk, xen-devel, virtualization, linux-kernel
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 <nikai@nikai.net>
---
drivers/xen/events.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 036343b..589f0a5 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -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)
@@ -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)
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xen: events: fix error checks in bind_*_to_irqhandler()
2011-03-30 19:14 [PATCH] xen: events: fix error checks in bind_*_to_irqhandler() Nicolas Kaiser
@ 2011-03-30 19:31 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 2+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-03-30 19:31 UTC (permalink / raw)
To: Nicolas Kaiser, Ian Campbell
Cc: Jeremy Fitzhardinge, xen-devel, virtualization, linux-kernel
On Wed, Mar 30, 2011 at 09:14:26PM +0200, Nicolas Kaiser wrote:
> 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.
Whoops. Good check. Will have it queue up for rc2.
Will fix up the bind_virq_to_irqhandler case as well.
>
> Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
> ---
> drivers/xen/events.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 036343b..589f0a5 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -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)
> @@ -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)
> --
> 1.7.3.4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-30 19:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30 19:14 [PATCH] xen: events: fix error checks in bind_*_to_irqhandler() Nicolas Kaiser
2011-03-30 19:31 ` Konrad Rzeszutek Wilk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox