drm/amd/pm: Fix warnings
authorLijo Lazar <lijo.lazar@amd.com>
Fri, 27 Oct 2023 05:32:26 +0000 (11:02 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 31 Oct 2023 20:40:15 +0000 (16:40 -0400)
Fixes warnings:

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:286:45:
warning: '%s' directive output may be truncated writing up to 29 bytes
into a region of size 23 [-Wformat-truncation=]
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:286:52:
warning: '%s' directive output may be truncated writing up to 29 bytes
into a region of size 23 [-Wformat-truncation=]
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu14/smu_v14_0.c:72:45: warning:
'%s' directive output may be truncated writing up to 29 bytes into a
region of size 23 [-Wformat-truncation=]
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu14/smu_v14_0.c:72:52: warning:
'%s' directive output may be truncated writing up to 29 bytes into a
region of size 23 [-Wformat-truncation=]

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c

index f42b48b31927071d90f7af5eb7474d8d778b34b7..20f66e696f87391ffec8c7963020495d805bd11f 100644 (file)
@@ -270,7 +270,7 @@ static int smu_v13_0_6_init_microcode(struct smu_context *smu)
        struct amdgpu_device *adev = smu->adev;
        uint32_t p2s_table_id = P2S_TABLE_ID_A;
        int ret = 0, i, p2stable_count;
-       char ucode_prefix[30];
+       char ucode_prefix[15];
        char fw_name[30];
 
        /* No need to load P2S tables in IOV mode */
index 4ac22f44d160c615b90c2902eb3b9f5345730318..01f2ab4567246f32979004af9490b5ffecc5e1ab 100644 (file)
@@ -57,7 +57,7 @@ int smu_v14_0_init_microcode(struct smu_context *smu)
 {
        struct amdgpu_device *adev = smu->adev;
        char fw_name[30];
-       char ucode_prefix[30];
+       char ucode_prefix[15];
        int err = 0;
        const struct smc_firmware_header_v1_0 *hdr;
        const struct common_firmware_header *header;