lkml.org 
[lkml]   [2008]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] uio_pdrv: Unique IRQ Mode
Hello Paul,

> > diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
> > index cdf338d..671a7a8 100644
> > --- a/include/linux/uio_driver.h
> > +++ b/include/linux/uio_driver.h
> > @@ -63,6 +63,7 @@ struct uio_info {
> > long irq;
> > unsigned long irq_flags;
> > void *priv;
> > + unsigned int flags;
> > irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
> > int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
> > int (*open)(struct uio_info *info, struct inode *inode);
>
> This should be unsigned long.
Is this only because test_and_set_bit takes an unsigned long? Or is a
long type preferable in general?

> > +static inline irqreturn_t uio_userirq_handler(int irq,
> > + struct uio_info *dev_info)
> > +{
> > + int ret;
> > +
> > + if (likely(dev_info->irqcontrol)) {
> > + ret = dev_info->irqcontrol(dev_info, 0);
> > + if (ret) {
> > + pr_warning("%s: failed to disable irq\n", __func__);
> > + return IRQ_NONE;
> > + } else
> > + return IRQ_HANDLED;
> > + } else
> > + return IRQ_NONE;
> > +}
> > +
> You can simplify this by just using IRQ_RETVAL() on
> dev_info->irqcontrol(...). The printk() shouldn't be necessary, as the
> other layers should already catch that.
Right, we can make this:

static inline irqreturn_t uio_userirq_handler(int irq,
struct uio_info *dev_info)
{
int ret = -1;

if (likely(dev_info->irqcontrol))
ret = dev_info->irqcontrol(dev_info, 0);

return IRQ_RETVAL(ret == 0);
}

Best regards
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-06-10 21:29    [W:0.112 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site