[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 18 Dec 2021 09:54:16 +0800
From: davidcomponentone@...il.com
To: perex@...ex.cz
Cc: davidcomponentone@...il.com, tiwai@...e.com, broonie@...nel.org,
joe@...ches.com, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, Yang Guang <yang.guang5@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] ALSA: hda: use swap() to make code cleaner
From: Yang Guang <yang.guang5@....com.cn>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: David Yang <davidcomponentone@...il.com>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
sound/pci/hda/hda_auto_parser.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 4a854475a0e6..82c492b05667 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -92,14 +92,10 @@ static int compare_input_type(const void *ap, const void *bp)
*/
static void reorder_outputs(unsigned int nums, hda_nid_t *pins)
{
- hda_nid_t nid;
-
switch (nums) {
case 3:
case 4:
- nid = pins[1];
- pins[1] = pins[2];
- pins[2] = nid;
+ swap(pins[1], pins[2]);
break;
}
}
--
2.30.2
Powered by blists - more mailing lists