Skip to content

Commit fa019ba

Browse files
Yihao Hanpavelmachek
authored andcommitted
leds: tca6507: use swap() to make code cleaner
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]>
1 parent 679f865 commit fa019ba

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/leds/leds-tca6507.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,7 @@ static int choose_times(int msec, int *c1p, int *c2p)
242242
if (diff < 65536) {
243243
int actual;
244244
if (msec & 1) {
245-
c1 = *c2p;
246-
*c2p = *c1p;
247-
*c1p = c1;
245+
swap(*c2p, *c1p);
248246
}
249247
actual = time_codes[*c1p] + time_codes[*c2p];
250248
if (*c1p < *c2p)

0 commit comments

Comments
 (0)