aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch
new file mode 100644
index 00000000..e818f35b
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4581-drm-amdgpu-Use-ARRAY_SIZE-for-sos_old_versions.patch
@@ -0,0 +1,32 @@
+From fc4ba60efac03b9af545aee58cd5918ce5e601c2 Mon Sep 17 00:00:00 2001
+From: zhengbin <zhengbin13@huawei.com>
+Date: Fri, 22 Nov 2019 11:42:52 +0800
+Subject: [PATCH 4581/4736] drm/amdgpu: Use ARRAY_SIZE for sos_old_versions
+
+Fixes coccicheck warning:
+
+drivers/gpu/drm/amd/amdgpu/psp_v3_1.c:182:40-41: WARNING: Use ARRAY_SIZE
+
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: zhengbin <zhengbin13@huawei.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+index 839806cf1c6a..773e272efc93 100644
+--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
++++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+@@ -177,7 +177,7 @@ static bool psp_v3_1_match_version(struct amdgpu_device *adev, uint32_t ver)
+ * Double check if the latest four legacy versions.
+ * If yes, it is still the right version.
+ */
+- for (i = 0; i < sizeof(sos_old_versions) / sizeof(uint32_t); i++) {
++ for (i = 0; i < ARRAY_SIZE(sos_old_versions); i++) {
+ if (sos_old_versions[i] == adev->psp.sos_fw_version)
+ return true;
+ }
+--
+2.17.1
+