mbox series

[-next,0/3] drm: use clamp() instead of min(max())

Message ID 20240830012216.603623-1-lizetao1@huawei.com (mailing list archive)
Headers show
Series drm: use clamp() instead of min(max()) | expand

Message

Li Zetao Aug. 30, 2024, 1:22 a.m. UTC
Hi,

When it needs to get the value of a certain interval [min, max],
it is easier to understand using clamp(x, min, max) instead of
min(max(x, min), max). What needs to be determined is that min
should be smaller than max.

Li Zetao (3):
  drm/amd: use clamp() in amdgpu_pll_get_fb_ref_div()
  drm/amdgpu: use clamp() in amdgpu_vm_adjust_size()
  drm/amdgpu: use clamp() in nvkm_volt_map()

 drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c         | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c          | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)