aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus
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 /drivers/sbus
parentdisplay7seg: Introduce the use of the managed version of kzalloc (diff)
downloadlinux-dev-54dcf0ceb8a21a898cd436617483e5646f2edcc6.tar.xz
linux-dev-54dcf0ceb8a21a898cd436617483e5646f2edcc6.zip
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>
Diffstat (limited to 'drivers/sbus')
-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;
}