Re: why not choose another way to define the _IOC_xxxMASK related to the ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 30 Mar 2013 18:01:32 +0800, RS said:
>
> Now I think this will spend more time than the kernel code when executed.

Have you actually examined the generated code on several popular
architectures to see what gcc actually does?

(hint - many things can constant-folded at compile time.  So if
the 3 values are #defined to constants, the expression

    (_IOC_NRSHIFT >> _IOC_NRBITS) - _IOC_NRSHIFT)

will generate no actual shift or subtract instructions, merely another
constant.

Attachment: pgpz33hc9oR3d.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux