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

Uwe Kleine-König
2008-05-23T10:56:34Z

Hello Hans,

Hans J. Koch wrote:
> Am Fri, 23 May 2008 11:10:09 +0200
> schrieb Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>:
>
> > Hans J. Koch wrote:
> > > Am Fri, 23 May 2008 07:55:27 +0200
> > > schrieb Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>:
> > >
> > > > Hello Hans,
> > > >
> > > > > - Copyright (c) 2006 by Hans-JÃŒrgen Koch.
> > > > > + Copyright (c) 2006-2008 by Hans-JÃŒrgen Koch.
> > > > 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