summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYihao Han <hanyihao@vivo.com>2021-11-15 04:24:28 +0100
committerPavel Machek <pavel@ucw.cz>2022-01-12 19:43:14 +0100
commitfa019ba4f202bce2aa1c6fcaead828d9625b9084 (patch)
tree0874152a36d5a2e79270cd35c07441781e486aa5
parentleds: Add mt6360 driver (diff)
downloadlinux-fa019ba4f202bce2aa1c6fcaead828d9625b9084.tar.xz
linux-fa019ba4f202bce2aa1c6fcaead828d9625b9084.zip
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 <hanyihao@vivo.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
-rw-r--r--drivers/leds/leds-tca6507.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 225b765830bd..de8eed9b667d 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -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)