mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	drm/amdgpu: prefer snprintf over sprintf
This will trade the W=1 warning -Wformat-overflow to -Wformat-truncation. This lets us enable -Wformat-overflow subsystem wide. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Pan, Xinhui <Xinhui.Pan@amd.com> Cc: amd-gfx@lists.freedesktop.org Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/fea7a52924f98b1ac24f4a7e6ba21d7754422430.1704908087.git.jani.nikula@intel.com
This commit is contained in:
		
							parent
							
								
									9a9e8a7159
								
							
						
					
					
						commit
						345a36c4f1
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -329,7 +329,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ring->eop_gpu_addr = kiq->eop_gpu_addr;
 | 
						ring->eop_gpu_addr = kiq->eop_gpu_addr;
 | 
				
			||||||
	ring->no_scheduler = true;
 | 
						ring->no_scheduler = true;
 | 
				
			||||||
	sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
 | 
						snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
 | 
				
			||||||
 | 
							 xcc_id, ring->me, ring->pipe, ring->queue);
 | 
				
			||||||
	r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
 | 
						r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
 | 
				
			||||||
			     AMDGPU_RING_PRIO_DEFAULT, NULL);
 | 
								     AMDGPU_RING_PRIO_DEFAULT, NULL);
 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue