mirror of
https://github.com/torvalds/linux
synced 2024-09-06 09:51:23 +00:00
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>
This commit is contained in:
parent
57a4a3d7f7
commit
54dcf0ceb8
|
@ -144,10 +144,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
|
||||
case D7SIOCTM:
|
||||
/* toggle device mode-- flip display orientation */
|
||||
if (regs & D7S_FLIP)
|
||||
regs &= ~D7S_FLIP;
|
||||
else
|
||||
regs |= D7S_FLIP;
|
||||
regs ^= D7S_FLIP;
|
||||
writeb(regs, p->regs);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue