lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 10 Jun 2008 21:24:12 +0200
From:	Uwe Kleine-König <Uwe.Kleine-Koenig@...i.com>
To:	Paul Mundt <lethal@...ux-sh.org>,
	Magnus Damm <magnus.damm@...il.com>,
	"Hans J. Koch" <hjk@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"gregkh@...e.de" <gregkh@...e.de>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"tglx@...utronix.de" <tglx@...utronix.de>
Subject: Re: [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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ