[PATCH] powerpc: sysdev: cpm1: Optimise gpio bit calculation

Segher Boessenkool segher at kernel.crashing.org
Sat Mar 11 00:06:30 AEDT 2017


On Fri, Mar 10, 2017 at 11:54:19AM +0100, Christophe LEROY wrote:
> gpio_get() and gpio_set() are used extensively by some GPIO based 
> drivers like SPI, NAND, so it may be worth it as it doesn't impair 
> readability (if anyone prefers, we could write  (1 << 31) >> i  instead 
> of  0x80000000 >> i )

1 << 31 is undefined behaviour, of course.


Segher


More information about the Linuxppc-dev mailing list