drm/amd/amdgpu/amdgpu_ras: Increase buffer size to account for all possible values
authorLee Jones <lee@kernel.org>
Thu, 24 Aug 2023 07:37:02 +0000 (08:37 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Aug 2023 19:27:03 +0000 (15:27 -0400)
Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_sysfs_create’:
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1406:20: warning: ‘_err_count’ directive output may be truncated writing 10 bytes into a region of size between 1 and 32 [-Wformat-truncation=]
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1405:9: note: ‘snprintf’ output between 11 and 42 bytes into a destination of size 32

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h

index ffb49b2..7999d20 100644 (file)
@@ -436,7 +436,7 @@ struct amdgpu_ras {
 };
 
 struct ras_fs_data {
-       char sysfs_name[32];
+       char sysfs_name[48];
        char debugfs_name[32];
 };