Skip to content

Commit

Permalink
leds: tca6507: use swap() to make code cleaner
Browse files Browse the repository at this point in the history
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Signed-off-by: Yihao Han <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
  • Loading branch information
Yihao Han authored and pavelmachek committed Jan 12, 2022
1 parent 679f865 commit fa019ba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/leds/leds-tca6507.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ static int choose_times(int msec, int *c1p, int *c2p)
if (diff < 65536) {
int actual;
if (msec & 1) {
c1 = *c2p;
*c2p = *c1p;
*c1p = c1;
swap(*c2p, *c1p);
}
actual = time_codes[*c1p] + time_codes[*c2p];
if (*c1p < *c2p)
Expand Down

0 comments on commit fa019ba

Please sign in to comment.