lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220914073756.4736-1-hanyihao@vivo.com>
Date:   Wed, 14 Sep 2022 00:36:43 -0700
From:   Yihao Han <hanyihao@...o.com>
To:     Harry Wentland <harry.wentland@....com>,
        Leo Li <sunpeng.li@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, Jerry Zuo <jerry.zuo@....com>,
        Charlene Liu <Charlene.Liu@....com>,
        Nevenko Stupar <Nevenko.Stupar@....com>,
        Wenjing Liu <wenjing.liu@....com>,
        Leo Chen <SanChuan.Chen@....com>,
        George Shen <george.shen@....com>,
        Tales Aparecida <tales.aparecida@...il.com>,
        Yang Li <yang.lee@...ux.alibaba.com>,
        Aurabindo Pillai <aurabindo.pillai@....com>,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Cc:     Yihao Han <hanyihao@...o.com>
Subject: [PATCH] drm/amdgpu/display: using swap() instead of temp variable

Use swap() instead of the temp variable to swap values.

Signed-off-by: Yihao Han <hanyihao@...o.com>
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 6 +-----
 1 file changed, 1 insertion(+), 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 85ed0afb74a9..7ef528c5b700 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
@@ -2907,7 +2907,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;
 
@@ -2983,10 +2982,7 @@ 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.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ