> > +static int tipar_open(struct inode *inode, struct file *file)
> > +{
> > + unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR_0;
> > +
> > + if (minor >= PP_NO)
> > + return -ENXIO;
> > +
> > + if(table[minor].opened)
> > + return -EBUSY;
> > +
> > + table[minor].opened++;
> > +
>
> I think <asm/bitops.h> operations on one unsigned long for all devices
> would be better, and at least non-racy.
Well, but I have never seen a such use in any kernrl modules. Is it the right
way to use ?
>
> > + case TIPAR_DELAY:
> > + delay = arg;
>
> Needs get_user/copy_from_user
In the modules tree, they use copy_to_user. They use the same construction
rather than using get_user. More informations ?
Romain
--- Romain Liévin (aka roms) http://lpg.ticalc.org/prj_tilp, prj_usb, prj_tidev, prj_gtktiemu mail: roms@lpg.ticalc.org - 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/
This archive was generated by hypermail 2b29 : Fri Mar 15 2002 - 22:00:18 EST