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: pgp48fQJlrpug.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to