mbox series

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

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

Message

Li Zetao Aug. 31, 2024, 1:28 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.

v1 -> v2: Change the title prefix of patch 3 to drm/nouveau/volt
v1: https://lore.kernel.org/all/20240830012216.603623-1-lizetao1@huawei.com/

Li Zetao (3):
  drm/amd: use clamp() in amdgpu_pll_get_fb_ref_div()
  drm/amdgpu: use clamp() in amdgpu_vm_adjust_size()
  drm/nouveau/volt: 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(-)