drm/amdgpu: Use seq_putc() in two functions
Subsystems (3)
PATCH 1/1 drm/amdgpu: Use seq_putc() in two functions
From: Markus Elfring <[email protected]>
Date: Fri, 12 Jan 2018 22:08:50 +0100
A few single characters should be put into a sequence. Thus use the corresponding function "seq_putc".
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
@@ -806,8 +806,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data) pin_count =READ_ONCE (bo->pin_count);if (pin_count)seq_printf (m," pin count %d" , pin_count); -seq_printf (m,"\n" ); +seq_putc (m,'\n' );return 0 ; }
drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +3 -6
@@ -419,11 +419,8 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,list_for_each_entry (i, &sa_manager->olist, olist) {uint64_t soffset = i->soffset + sa_manager->gpu_addr;uint64_t eoffset = i->eoffset + sa_manager->gpu_addr; -if (&i->olist == sa_manager->hole) { -seq_printf (m,">" ); - }else { -seq_printf (m," " ); - } + +seq_putc (m, (&i->olist == sa_manager->hole) ?'>' :' ' );seq_printf (m,"[0x%010llx 0x%010llx] size %8lld" , soffset, eoffset, eoffset - soffset);
@@ -431,7 +428,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,seq_printf (m," protected by 0x%08x on context %llu" , i->fence->seqno, i->fence->context); -seq_printf (m,"\n" ); +seq_putc (m,'\n' ); }spin_unlock (&sa_manager->wq.lock); }
Signature · 1 line
2.15.1