summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-06-19 14:31:52 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-21 21:37:05 -0700
commit54dcf0ceb8a21a898cd436617483e5646f2edcc6 (patch)
treebf1bfe0d48cb9858987ee54f36270ae23a9bba40
parent57a4a3d7f7568c487d5db3e26540bff958000255 (diff)
downloadlinux-54dcf0ceb8a21a898cd436617483e5646f2edcc6.tar.bz2
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>
-rw-r--r--drivers/sbus/char/display7seg.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index b48899ce8506..2b0ce7c350ee 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -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;
}