Skip to content

Commit 44fd83e

Browse files
srishanmalexdeucher
authored andcommitted
drm/amdgpu: Replace ternary operator with min() in 'amdgpu_iomem_read'
Fixes the following coccicheck: drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2427:16-17: WARNING opportunity for min() min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Cc: Guchun Chen <guchun.chen@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent b73b737 commit 44fd83e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2420,7 +2420,7 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf,
24202420
struct page *p;
24212421
void *ptr;
24222422

2423-
bytes = bytes < size ? bytes : size;
2423+
bytes = min(bytes, size);
24242424

24252425
/* Translate the bus address to a physical address. If
24262426
* the domain is NULL it means there is no IOMMU active

0 commit comments

Comments
 (0)