Skip to content

Commit

Permalink
drivers/sbus/char: Micro-optimization in display7seg.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Villemoes authored and davem330 committed Jul 22, 2014
1 parent 57a4a3d commit 54dcf0c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/sbus/char/display7seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 54dcf0c

Please sign in to comment.