aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivasan Shanmugam <[email protected]>2023-08-12 20:17:24 +0530
committerAlex Deucher <[email protected]>2023-08-15 18:08:28 -0400
commit44fd83e920e2ec0322ad82320ca575445b5e135e (patch)
treefe4134fad1f911abda35a1ba720705a5d99722f6
parentb73b737f3dd5fb75233645413a73e4eb7da7a41c (diff)
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 <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Pan, Xinhui" <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index dea848bb55c1..d9adc520f656 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2420,7 +2420,7 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf,
struct page *p;
void *ptr;
- bytes = bytes < size ? bytes : size;
+ bytes = min(bytes, size);
/* Translate the bus address to a physical address. If
* the domain is NULL it means there is no IOMMU active