diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-06-19 14:31:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-21 21:37:05 -0700 |
commit | 54dcf0ceb8a21a898cd436617483e5646f2edcc6 (patch) | |
tree | bf1bfe0d48cb9858987ee54f36270ae23a9bba40 /drivers/sbus | |
parent | 57a4a3d7f7568c487d5db3e26540bff958000255 (diff) |
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.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index b48899ce850..2b0ce7c350e 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; } |