diff options
| author | Srinivasan Shanmugam <[email protected]> | 2023-09-03 06:52:25 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-09-06 18:35:22 +0000 |
| commit | eb3b214c37edd323b496b256bb492592aa51c6f2 (patch) | |
| tree | 3a47a5ddb84f8fb1315da6f30e597767c8b03b00 /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |
| parent | drm/amd: Add umc v12_0_0 ip headers (diff) | |
| download | kernel-eb3b214c37edd323b496b256bb492592aa51c6f2.tar.gz kernel-eb3b214c37edd323b496b256bb492592aa51c6f2.zip | |
drm/amdgpu: Use min_t to replace min
Use min_t to replace min, min_t is a bit fast because min use
twice typeof.
And using min_t is cleaner here since the min/max macros
do a typecheck while min_t()/max_t() to an explicit type cast.
Fixes the below checkpatch warning:
WARNING: min() should probably be min_t()
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index f5793ec4b7c4..80bcbe744e58 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c @@ -1089,7 +1089,7 @@ static ssize_t amdgpu_debugfs_vcn_fwlog_read(struct file *f, char __user *buf, if (write_pos > read_pos) { available = write_pos - read_pos; - read_num[0] = min(size, (size_t)available); + read_num[0] = min_t(size_t, size, available); } else { read_num[0] = AMDGPU_VCNFW_LOG_SIZE - read_pos; available = read_num[0] + write_pos - plog->header_size; |
