mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: your mail (tipar)
       [not found] <200203132044.g2DKiba00923@ns.caldera.de>
@ 2002-03-14 18:51 ` Romain Liévin
  0 siblings, 0 replies; only message in thread
From: Romain Liévin @ 2002-03-14 18:51 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Kernel List


> > +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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-14 18:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200203132044.g2DKiba00923@ns.caldera.de>
2002-03-14 18:51 ` your mail (tipar) Romain Liévin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®