[PATCH linux-next] drm/amd/display: Swap with swap() function Use swap() to instead of : temp = a; a =b; b = temp;

From: cgel . zte
Date: Sun Jul 31 2022 - 22:20:52 EST


From: ye xingchen <ye.xingchen@xxxxxxxxxx>

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
index 09fbb7ad5362..6e36a0f5989d 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
@@ -2906,7 +2906,6 @@ static enum bp_result construct_integrated_info(
struct atom_common_table_header *header;
struct atom_data_revision revision;

- struct clock_voltage_caps temp = {0, 0};
uint32_t i;
uint32_t j;

@@ -2982,10 +2981,8 @@ static enum bp_result construct_integrated_info(
info->disp_clk_voltage[j-1].max_supported_clk
) {
/* swap j and j - 1*/
- temp = info->disp_clk_voltage[j-1];
- info->disp_clk_voltage[j-1] =
- info->disp_clk_voltage[j];
- info->disp_clk_voltage[j] = temp;
+ swap(info->disp_clk_voltage[j-1],
+ info->disp_clk_voltage[j]);
}
}
}
--
2.25.1