All of lore.kernel.org
 help / color / mirror / Atom feed
* why not choose another way to define the _IOC_xxxMASK related to the ioctl
@ 2013-03-30  5:47 RS
  2013-03-30  8:41 ` Tobias Boege
  0 siblings, 1 reply; 4+ messages in thread
From: RS @ 2013-03-30  5:47 UTC (permalink / raw)
  To: kernelnewbies

it defines in the kernel:  #define _IOC_NRMASK	((1 << _IOC_NRBITS)-1)   //define  ...  #define _IOC_NRSHIFT	0  ...  #define _IOC_DIR(nr)		(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)  //when decode

why not define it like this:
  #define _IOC_NRSHIFT	0
  ...
  #define _IOC_NRMASK ((_IOC_NRSHIFT >> _IOC_NRBITS) - _IOC_NRSHIFT)   //define
  ...
  #define _IOC_DIR(nr)        ((nr &  _IOC_DIRMASK) >> _IOC_DIRSHIFT)  // when decode


I think it is better for the word "mask" . 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130330/d0df0713/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-30 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30  5:47 why not choose another way to define the _IOC_xxxMASK related to the ioctl RS
2013-03-30  8:41 ` Tobias Boege
2013-03-30 10:01   ` RS
2013-03-30 15:59     ` Valdis.Kletnieks at vt.edu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.