[PATCH -next -v2 1/3] drm/amd: use clamp() in amdgpu_pll_get_fb_ref_div()

2024-08-31 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Reviewed-by: Christian König Signed-off-by: Li Zetao --- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

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

2024-08-31 Thread Li Zetao
v1: https://lore.kernel.org/all/20240830012216.603623-1-lizet...@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

[PATCH -next -v2 2/3] drm/amdgpu: use clamp() in amdgpu_vm_adjust_size()

2024-08-31 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Reviewed-by: Christian König Signed-off-by: Li Zetao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH -next -v2 3/3] drm/nouveau/volt: use clamp() in nvkm_volt_map()

2024-08-31 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Reviewed-by: Lyude Paul Signed-off-by: Li Zetao --- v1 -> v2: Change the patch title prefix to drm/nouveau/volt v1: https://lore.kernel.org/all/20240830012216.60362

[PATCH -next 1/3] drm/amd: use clamp() in amdgpu_pll_get_fb_ref_div()

2024-08-30 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Signed-off-by: Li Zetao --- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu

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

2024-08-30 Thread Li Zetao
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

[PATCH -next 3/3] drm/amdgpu: use clamp() in nvkm_volt_map()

2024-08-30 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Signed-off-by: Li Zetao --- drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm

[PATCH -next 2/3] drm/amdgpu: use clamp() in amdgpu_vm_adjust_size()

2024-08-30 Thread Li Zetao
When it needs to get a value within a certain interval, using clamp() makes the code easier to understand than min(max()). Signed-off-by: Li Zetao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH -next] drm/msm/adreno: Use kvmemdup to simplify the code

2024-08-21 Thread Li Zetao
Use kvmemdup instead of kvmalloc() + memcpy() to simplify the code. No functional change intended. Signed-off-by: Li Zetao --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers

[PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname()

2023-08-02 Thread Li Zetao
Convert platform_get_resource_byname() + devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does. Signed-off-by: Li Zetao --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions

[PATCH v2 4/5] virtio-blk: Fix probe failed when modprobe virtio_blk

2022-11-30 Thread Li Zetao
modern_find_vqs(), all queues will be selected and activated, but once queues are enabled there is no way to go back except reset. Fix it by reset virtio device on error handling path. After init_vq() succeeded, all virtqueues should be stopped on error handling path. Signed-off-by: Li Ze

[PATCH v2 0/5] Fix probe failed when modprobe modules

2022-11-30 Thread Li Zetao
/20221128021005.232105-1-lizet...@huawei.com/ Li Zetao (5): 9p: Fix probe failed when modprobe 9pnet_virtio virtio-mem: Fix probe failed when modprobe virtio_mem virtio-input: Fix probe failed when modprobe virtio_input virtio-blk: Fix probe failed when modprobe virtio_blk drm/virtio: Fix

[PATCH v2 5/5] drm/virtio: Fix probe failed when modprobe virtio_gpu

2022-11-30 Thread Li Zetao
on error handling path. After virtio_find_vqs() succeeded, all virtqueues should be stopped on error handling path. Fixes: dc5698e80cf7 ("Add virtio gpu driver.") Signed-off-by: Li Zetao --- v1 -> v2: patch is new. drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 inserti

[PATCH v2 1/5] 9p: Fix probe failed when modprobe 9pnet_virtio

2022-11-30 Thread Li Zetao
on error handling path. After virtio_find_single_vq() succeeded, all virtqueues should be stopped on error handling path. Fixes: ea52bf8eda98 ("9p/trans_virtio: reset virtio device on remove") Signed-off-by: Li Zetao Reviewed-by: Christian Schoenebeck --- v1 -> v2: modify the descri

[PATCH v2 2/5] virtio-mem: Fix probe failed when modprobe virtio_mem

2022-11-30 Thread Li Zetao
ath. After virtio_mem_init_vq() succeeded, all virtqueues should be stopped on error handling path. Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug") Signed-off-by: Li Zetao Reviewed-by: David Hildenbrand --- v1 -> v2: modify the description error of the te

[PATCH v2 3/5] virtio-input: Fix probe failed when modprobe virtio_input

2022-11-30 Thread Li Zetao
ng path. Fixes: 271c865161c5 ("Add virtio-input driver.") Signed-off-by: Li Zetao --- v1 -> v2: modify the description error of the test case in step 3 and modify the fixes tag information. drivers/virtio/virtio_input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/driv