diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-06-19 14:31:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-22 06:37:05 +0200 |
commit | 54dcf0ceb8a21a898cd436617483e5646f2edcc6 (patch) | |
tree | bf1bfe0d48cb9858987ee54f36270ae23a9bba40 /drivers/sbus/char/display7seg.c | |
parent | display7seg: Introduce the use of the managed version of kzalloc (diff) | |
download | linux-54dcf0ceb8a21a898cd436617483e5646f2edcc6.tar.xz linux-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/char/display7seg.c')
-rw-r--r-- | drivers/sbus/char/display7seg.c | 5 |
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; } |