Re: [PATCH 1/1] UIO: Add a write() function to enable/disable interrupts

From: Uwe Kleine-König
Date: Fri May 23 2008 - 06:56:34 EST


Hello Hans,

Hans J. Koch wrote:
> Am Fri, 23 May 2008 11:10:09 +0200
> schrieb Uwe Kleine-KÃnig <Uwe.Kleine-Koenig@xxxxxxxx>:
>
> > Hans J. Koch wrote:
> > > Am Fri, 23 May 2008 07:55:27 +0200
> > > schrieb Uwe Kleine-KÃnig <Uwe.Kleine-Koenig@xxxxxxxx>:
> > >
> > > > Hello Hans,
> > > >
> > > > > - Copyright (c) 2006 by Hans-JÃÅrgen Koch.</para>
> > > > > + Copyright (c) 2006-2008 by Hans-JÃÅrgen Koch.</para>
> > > > This looks wrong.
> > >
> > > DocBook XML is supposed to be UTF-8.
> > Correct. But still the problem is real. The headers of your mail
> > claim the content to be encoded in UTF-8, but actually it's latin1.
> > So I cannot apply the patch you sent with git am without hand editing.
>
> Try the version below.
This one is better---I can apply it.

> + if (copy_from_user(&irq_on, buf, count))
> + return -EFAULT;
> +
> + if (!idev->info->irqcontrol)
> + return -ENOSYS;
I would swap these two. copy_from_user is more expensive than testing
idev->info->irqcontrol. (Is it really?) Anyhow only fetching a value
from userspace if you really need it looks more clean to me.

Otherwise the patch looks fine.

Uwe


--
Uwe Kleine-KÃnig, Software Engineer
Digi International GmbH Branch Breisach, KÃferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/