Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/sbus/char: Micro-optimization in display7seg.c

Flipping a bit doesn't need four lines of code; and gcc seems to
actually generate two branches.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Rasmus Villemoes and committed by
David S. Miller
54dcf0ce 57a4a3d7

+1 -4
+1 -4
drivers/sbus/char/display7seg.c
··· 144 144 145 145 case D7SIOCTM: 146 146 /* toggle device mode-- flip display orientation */ 147 - if (regs & D7S_FLIP) 148 - regs &= ~D7S_FLIP; 149 - else 150 - regs |= D7S_FLIP; 147 + regs ^= D7S_FLIP; 151 148 writeb(regs, p->regs); 152 149 break; 153 150 }