drm/amd/pm/smu7: Remove unused smu7_copy_bytes_from_smc
authorDr. David Alan Gilbert <linux@treblig.org>
Wed, 7 May 2025 00:24:23 +0000 (01:24 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 May 2025 21:46:00 +0000 (17:46 -0400)
smu7_copy_bytes_from_smc() was added in 2016 by
commit 1ff55f465103 ("drm/amd/powerplay: implement smu7_smumgr for asics
with smu ip version 7.")

but never used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.h

index 5a010cd3830373731abf594a190054ac998d035f..baf51cd82a350fe7882bc6422f9fe5a1a928443c 100644 (file)
@@ -46,42 +46,6 @@ static int smu7_set_smc_sram_address(struct pp_hwmgr *hwmgr, uint32_t smc_addr,
 }
 
 
-int smu7_copy_bytes_from_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address, uint32_t *dest, uint32_t byte_count, uint32_t limit)
-{
-       uint32_t data;
-       uint32_t addr;
-       uint8_t *dest_byte;
-       uint8_t i, data_byte[4] = {0};
-       uint32_t *pdata = (uint32_t *)&data_byte;
-
-       PP_ASSERT_WITH_CODE((0 == (3 & smc_start_address)), "SMC address must be 4 byte aligned.", return -EINVAL);
-       PP_ASSERT_WITH_CODE((limit > (smc_start_address + byte_count)), "SMC address is beyond the SMC RAM area.", return -EINVAL);
-
-       addr = smc_start_address;
-
-       while (byte_count >= 4) {
-               smu7_read_smc_sram_dword(hwmgr, addr, &data, limit);
-
-               *dest = PP_SMC_TO_HOST_UL(data);
-
-               dest += 1;
-               byte_count -= 4;
-               addr += 4;
-       }
-
-       if (byte_count) {
-               smu7_read_smc_sram_dword(hwmgr, addr, &data, limit);
-               *pdata = PP_SMC_TO_HOST_UL(data);
-       /* Cast dest into byte type in dest_byte.  This way, we don't overflow if the allocated memory is not 4-byte aligned. */
-               dest_byte = (uint8_t *)dest;
-               for (i = 0; i < byte_count; i++)
-                       dest_byte[i] = data_byte[i];
-       }
-
-       return 0;
-}
-
-
 int smu7_copy_bytes_to_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
                                const uint8_t *src, uint32_t byte_count, uint32_t limit)
 {
index e7303dc8c260b197146fca4d29bfc443c6f0d5e4..63e428ceaee4259eb374c5cf13d8bfa341529c42 100644 (file)
@@ -53,8 +53,6 @@ struct smu7_smumgr {
 };
 
 
-int smu7_copy_bytes_from_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
-                               uint32_t *dest, uint32_t byte_count, uint32_t limit);
 int smu7_copy_bytes_to_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
                        const uint8_t *src, uint32_t byte_count, uint32_t limit);
 int smu7_program_jump_on_start(struct pp_hwmgr *hwmgr);