提交 54dcf0ce 编写于 作者: R Rasmus Villemoes 提交者: David S. Miller

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: NRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 57a4a3d7
...@@ -144,10 +144,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -144,10 +144,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case D7SIOCTM: case D7SIOCTM:
/* toggle device mode-- flip display orientation */ /* toggle device mode-- flip display orientation */
if (regs & D7S_FLIP) regs ^= D7S_FLIP;
regs &= ~D7S_FLIP;
else
regs |= D7S_FLIP;
writeb(regs, p->regs); writeb(regs, p->regs);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册