<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tuikov, Luben <Luben.Tuikov@amd.com><br>
<b>Sent:</b> Wednesday, March 24, 2021 1:11 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Tuikov, Luben <Luben.Tuikov@amd.com>; Yang, Stanley <Stanley.Yang@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: Fix check for RAS support</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Use positive logic to check for RAS<br>
support. Rename the function to actually indicate<br>
what it is testing for. Essentially, make the<br>
function a predicate with the correct name.<br>
<br>
Cc: Stanley Yang <Stanley.Yang@amd.com><br>
Cc: Alexander Deucher <Alexander.Deucher@amd.com><br>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 15 ++++++---------<br>
 1 file changed, 6 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
index 0e16683876aa..17652972fd49 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
@@ -1933,15 +1933,12 @@ int amdgpu_ras_request_reset_on_boot(struct amdgpu_device *adev,<br>
         return 0;<br>
 }<br>
 <br>
-static int amdgpu_ras_check_asic_type(struct amdgpu_device *adev)<br>
+static bool amdgpu_ras_asic_supported(struct amdgpu_device *adev)<br>
 {<br>
-       if (adev->asic_type != CHIP_VEGA10 &&<br>
-               adev->asic_type != CHIP_VEGA20 &&<br>
-               adev->asic_type != CHIP_ARCTURUS &&<br>
-               adev->asic_type != CHIP_SIENNA_CICHLID)<br>
-               return 1;<br>
-       else<br>
-               return 0;<br>
+       return adev->asic_type == CHIP_VEGA10 ||<br>
+               adev->asic_type == CHIP_VEGA20 ||<br>
+               adev->asic_type == CHIP_ARCTURUS ||<br>
+               adev->asic_type == CHIP_SIENNA_CICHLID;<br>
 }<br>
 <br>
 /*<br>
@@ -1960,7 +1957,7 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev,<br>
         *supported = 0;<br>
 <br>
         if (amdgpu_sriov_vf(adev) || !adev->is_atom_fw ||<br>
-               amdgpu_ras_check_asic_type(adev))<br>
+           !amdgpu_ras_asic_supported(adev))<br>
                 return;<br>
 <br>
         if (amdgpu_atomfirmware_mem_ecc_supported(adev)) {<br>
-- <br>
2.31.0.97.g1424303384<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>