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>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 16 Apr 2022 17:41:24 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...ia.fr>
To:     kbuild-all@...ts.01.org, lkp@...el.com,
        linux-kernel@...r.kernel.org, Denis Efremov <efremov@...ux.com>,
        Julia Lawall <Julia.Lawall@...ia.fr>,
        Evan Quan <evan.quan@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, amd-gfx@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amdgpu/powerplay/vega10: fix minmax.cocci warnings

From: kernel test robot <lkp@...el.com>

Use max to simplify the code.

Generated by: scripts/coccinelle/misc/minmax.cocci

CC: Denis Efremov <efremov@...ux.com>
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: kernel test robot <lkp@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...ia.fr>

---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   028192fea1de083f4f12bfb1eb7c4d7beb5c8ecd
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
@@ -345,12 +345,10 @@ static int vega10_odn_initial_default_se
 		odn_table->min_vddc = dep_table[0]->entries[0].vddc;

 	i = od_table[2]->count - 1;
-	od_table[2]->entries[i].clk = hwmgr->platform_descriptor.overdriveLimit.memoryClock > od_table[2]->entries[i].clk ?
-					hwmgr->platform_descriptor.overdriveLimit.memoryClock :
-					od_table[2]->entries[i].clk;
-	od_table[2]->entries[i].vddc = odn_table->max_vddc > od_table[2]->entries[i].vddc ?
-					odn_table->max_vddc :
-					od_table[2]->entries[i].vddc;
+	od_table[2]->entries[i].clk = max(hwmgr->platform_descriptor.overdriveLimit.memoryClock,
+					  od_table[2]->entries[i].clk);
+	od_table[2]->entries[i].vddc = max(odn_table->max_vddc,
+					   od_table[2]->entries[i].vddc);

 	return 0;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ