]> git.baikalelectronics.ru Git - kernel.git/commitdiff
leds: tca6507: use swap() to make code cleaner
authorYihao Han <hanyihao@vivo.com>
Mon, 15 Nov 2021 03:24:28 +0000 (19:24 -0800)
committerPavel Machek <pavel@ucw.cz>
Wed, 12 Jan 2022 18:43:14 +0000 (19:43 +0100)
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-tca6507.c

index 225b765830bdc75d729a4123c0077dee3d817e54..de8eed9b667d1bc0cfec9644b3089ef321f70f9f 100644 (file)
@@ -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)