Patch "drm/amdgpu: Fix type mismatch in amdgpu_gfx_kiq_init_ring" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amdgpu: Fix type mismatch in amdgpu_gfx_kiq_init_ring

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amdgpu-fix-type-mismatch-in-amdgpu_gfx_kiq_init_.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 06d8e6172996b8e87339d86b3804145a3550b012
Author: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
Date:   Sat May 25 07:39:01 2024 +0530

    drm/amdgpu: Fix type mismatch in amdgpu_gfx_kiq_init_ring
    
    [ Upstream commit 745f7170db4ffd2f2e9751a2c719a97c9a5fc438 ]
    
    This commit fixes a type mismatch in the amdgpu_gfx_kiq_init_ring
    function triggered by the snprintf function expecting unsigned char
    arguments due to the '%hhu' format specifier, but receiving int and u32
    arguments.
    
    The issue occurred because the arguments xcc_id, ring->me, ring->pipe,
    and ring->queue were of type int and u32, not unsigned char. This led to
    a type mismatch when these arguments were passed to snprintf.
    
    To resolve this, the snprintf line was modified to cast these arguments
    to unsigned char. This ensures that the arguments are of the correct
    type for the '%hhu' format specifier and resolves the warning.
    
    Fixes the below:
    >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: warning: format
    >> specifies type 'unsigned char' but the argument has type 'int'
    >> [-Wformat]
                        xcc_id, ring->me, ring->pipe, ring->queue);
                        ^~~~~~
    >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:12: warning: format
    >> specifies type 'unsigned char' but the argument has type 'u32' (aka
    >> 'unsigned int') [-Wformat]
                        xcc_id, ring->me, ring->pipe, ring->queue);
                                ^~~~~~~~
       drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:22: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                        xcc_id, ring->me, ring->pipe, ring->queue);
                                          ^~~~~~~~~~
       drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:34: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
                        xcc_id, ring->me, ring->pipe, ring->queue);
                                                      ^~~~~~~~~~~
       4 warnings generated.
    
    Fixes: 0ea554455542 ("drm/amdgpu: Fix snprintf usage in amdgpu_gfx_kiq_init_ring")
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Closes: https://lore.kernel.org/oe-kbuild-all/202405250446.XeaWe66u-lkp@xxxxxxxxx/
    Cc: Lijo Lazar <lijo.lazar@xxxxxxx>
    Cc: Alex Deucher <alexander.deucher@xxxxxxx>
    Cc: Christian König <christian.koenig@xxxxxxx>
    Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
    Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 2cb8ab86efae8..e92bdc9a39d35 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -330,7 +330,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, int xcc_id)
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;
 	ring->no_scheduler = true;
 	snprintf(ring->name, sizeof(ring->name), "kiq_%hhu.%hhu.%hhu.%hhu",
-		 xcc_id, ring->me, ring->pipe, ring->queue);
+		 (unsigned char)xcc_id, (unsigned char)ring->me,
+		 (unsigned char)ring->pipe, (unsigned char)ring->queue);
 	r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
 			     AMDGPU_RING_PRIO_DEFAULT, NULL);
 	if (r)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux