[PATCH] video: fbdev: use if else instead

2022-03-29 Thread Qing Wang
From: Wang Qing use if and else instead of consequent if(A) and if (!A) Signed-off-by: Wang Qing --- drivers/video/fbdev/pxafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/video/fbdev/pxafb.c diff --git a/drivers/video/fbdev/pxafb.c b/drive

[PATCH] amdgpu: assign adev after null check

2022-02-14 Thread Qing Wang
From: Wang Qing adev should be assigned after a null check Signed-off-by: Wang Qing --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 2c9

[PATCH V3 13/13] media: vivid: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/test-drivers/vivid/vivid-kthread-cap.c | 3 ++- drivers/media/test-drivers/vivid/vivid-kthread-out.c | 3 ++- drivers/media/test-drivers/vivid/vi

[PATCH V3 12/13] media: wl128x: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/radio/wl128x/fmdrv_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/driver

[PATCH V3 11/13] media: tda8083: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/tda8083.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dv

[PATCH V3 10/13] md: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/md/dm-writecache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 5

[PATCH V3 10/13] media: stv0299: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/stv0299.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/medi

[PATCH V3 9/13] media: si21xx: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/si21xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-

[PATCH V3 7/13] md: use time_is_before_jiffies(() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index f4234d6..dced764 --- a/d

[PATCH V3 6/13] input: serio: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/input/serio/ps2-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpi

[PATCH V3 5/13] hid: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Acked-by: Srinivas Pandruvada --- drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ip

[PATCH V3 4/13] gpu: drm: radeon: use time_is_before_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/gpu/drm/radeon/radeon_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/rade

[PATCH V3 3/13] gpu: drm: i915: use time_is_after_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c

[PATCH V3 2/13] clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/clk/mvebu/armada-37xx-periph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/

[PATCH V3 1/13] block: xen: use time_is_before_eq_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- drivers/block/xen-blkback/blkback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/x

[PATCH V3 00/13] use time_is_{before, after}_jiffies() instead of open coding it

2022-02-14 Thread Qing Wang
From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. V2: Batch them in a series suggested by Joe. Use time_xxx_jiffies() instead of time_xxx() suggested by Kieran. V3: Fix subject and description suggested by Ted. Wang Qing (14): block: xen: u

[PATCH V2 13/13] media: vivid: use time_is_after_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/media/test-drivers/vivid/vivid-kthread-cap.c | 3 ++- drivers/media/test-drivers/vivid/vivid-kthread-out.c | 3 ++- drivers/media/test-drivers/vivid/v

[PATCH V2 12/13] media: wl128x: use time_is_before_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/media/radio/wl128x/fmdrv_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drive

[PATCH V2 11/13] media: tda8083: use time_is_after_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/tda8083.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/d

[PATCH V2 10/13] media: stv0299: use time_is_before_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/stv0299.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0299.c b/drivers/med

[PATCH V2 9/13] media: si21xx: use time_is_before_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/media/dvb-frontends/si21xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb

[PATCH V2 10/13] md: use time_is_before_eq_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/md/dm-writecache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index

[PATCH V2 7/13] md: use time_is_before_jiffies(() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/md/dm-thin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index f4234d6..dced764 --- a/

[PATCH V2 6/13] input: serio: use time_is_before_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/input/serio/ps2-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gp

[PATCH V2 5/13] hid: use time_is_after_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-i

[PATCH V2 4/13] gpu: drm: radeon: use time_is_before_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/gpu/drm/radeon/radeon_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/rad

[PATCH V2 3/13] gpu: drm: i915: use time_is_after_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/

[PATCH V2 2/13] clk: mvebu: use time_is_before_eq_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/clk/mvebu/armada-37xx-periph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mv

[PATCH V2 1/13] block: xen: use time_is_before_eq_jiffies() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/block/xen-blkback/blkback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/

[PATCH V2 00/13] use time_is_xxx() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_is_xxx() directly instead of jiffies judgment for understanding. Batch them in a series suggested by Joe. Wang Qing (14): block: xen: use time_is_before_eq_jiffies() instead of jiffies judgment clk: mvebu: use time_is_before_eq_jiffies() instead of j

[PATCH] gpu: drm: radeon: use time_after_eq() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/gpu/drm/radeon/radeon_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/rad

[PATCH] gpu: drm: i915: use time_after_eq() instead of jiffies judgment

2022-02-10 Thread Qing Wang
From: Wang Qing It is better use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/

[PATCH] gpu: drm: msm: use div64_u64() instead of do_div()

2022-02-09 Thread Qing Wang
From: Wang Qing do_div() does a 64-by-32 division. When the divisor is u64, do_div() truncates it to 32 bits, this means it can test non-zero and be truncated to zero for division. fix do_div.cocci warning: do_div() does a 64-by-32 division, please consider using div64_u64 instead. Signed-off-b

[PATCH V2] drm: nouveau: lsfw: cleanup coccinelle warning

2021-12-22 Thread Qing Wang
From: Wang Qing odd_ptr_err.cocci has complained about this warning for a long time: lsfw.c:194:5-11: inconsistent IS_ERR and PTR_ERR on line 195. Although there is no actual impact, it can improve scanning efficiency. Signed-off-by: Wang Qing --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.

[PATCH] drm: tegra: use vmemdup_user instead of kvmalloc and copy_from_user

2021-12-14 Thread Qing Wang
From: Wang Qing fix memdup_user.cocci warning: gpu/drm/tegra/submit.c:172:8-16: WARNING opportunity for vmemdup_user Signed-off-by: Wang Qing --- drivers/gpu/drm/tegra/submit.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/tegra/submit.c b/driv

[PATCH] drm: nouveau: lsfw: cleanup coccinelle warning

2021-12-14 Thread Qing Wang
From: Wang Qing odd_ptr_err.cocci has complained about this warning for a long time: lsfw.c:194:5-11: inconsistent IS_ERR and PTR_ERR on line 195. Although there is no actual impact, it can improve scanning efficiency. Signed-off-by: Wang Qing --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.

[PATCH] drm: nouveau: use vmemdup_user instead of kvmalloc and copy_from_user

2021-12-14 Thread Qing Wang
From: Wang Qing fix memdup_user.cocci warning: nouveau_gem.c:630:7-15: WARNING opportunity for vmemdup_user Signed-off-by: Wang Qing --- drivers/gpu/drm/nouveau/nouveau_gem.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c

[PATCH] gpu: drm: mcde: add missing of_node_put before return

2021-12-13 Thread Qing Wang
From: Wang Qing Fix following coccicheck warning: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return. Early exits from for_each_available_child_of_node should decrement the node reference counter. Signed-off-by: Wang Qing --- drivers/gpu/drm/mcde/mcd

[PATCH V2] gpu: drm: nouveau: switch over to vmemdup_user()

2021-10-18 Thread Qing Wang
This patch fixes the following Coccinelle warning: drivers/gpu/drm/nouveau/nouveau_gem.c:630: WARNING opportunity for vmemdup_user Use vmemdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Signed-off-by: Qing Wang --- drivers/gpu/drm

[PATCH V2] gpu: drm: tegra: switch over to vmemdup_user()

2021-10-18 Thread Qing Wang
This patch fixes the following Coccinelle warning: drivers/gpu/drm/tegra/submit.c:173: WARNING opportunity for vmemdup_user Use vmemdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Signed-off-by: Qing Wang --- drivers/gpu

[PATCH] gpu: drm: tegra: switch over to vmemdup_user()

2021-10-18 Thread Qing Wang
This patch fixes the following Coccinelle warning: drivers/gpu/drm/tegra/submit.c:173:8-15: WARNING \ opportunity for vmemdup_user Use vmemdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Signed-off-by: Qing Wang

[PATCH] gpu: drm: nouveau: switch over to vmemdup_user()

2021-10-18 Thread Qing Wang
This patch fixes the following Coccinelle warning: drivers/gpu/drm/nouveau/nouveau_gem.c:630: WARNING opportunity for vmemdup_user Use vmemdup_user rather than duplicating its implementation This is a little bit restricted to reduce false positives Signed-off-by: Qing Wang --- drivers/gpu/drm

[PATCH] drm: panel: replace snprintf in show functions with sysfs_emit

2021-10-14 Thread Qing Wang
instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang --- drivers/gpu/drm/panel/panel-dsi-cm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-dsi-cm.c b/drivers/gpu/drm/panel/panel-dsi-cm.c index 5fbfb71..a8efb06 100644

[PATCH] drm: nouveau: replace snprintf in show functions with sysfs_emit

2021-10-14 Thread Qing Wang
. drivers/gpu/drm/nouveau/nouveau_hwmon.c:90:8-16: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang --- drivers/gpu/drm/nouveau/nouveau_hwmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH] drm: arm: replace snprintf in show functions with sysfs_emit

2021-10-14 Thread Qing Wang
show() must not use snprintf() when formatting the value to be returned to user space. Fix the following coccicheck warning: drivers/gpu/drm/arm/malidp_drv.c:657:8-16: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang

[PATCH] amdgpu: replace snprintf in show functions with sysfs_emit

2021-10-14 Thread Qing Wang
show() must not use snprintf() when formatting the value to be returned to user space. Fix the following coccicheck warning: drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:427: WARNING: use scnprintf or sprintf. Signed-off-by: Qing Wang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c | 2 +- 1 file

[PATCH] video: omapfb: replace snprintf in show functions with sysfs_emit

2021-10-12 Thread Qing Wang
coccicheck complains about the use of snprintf() in sysfs show functions. Fix the coccicheck warning: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang --- drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c | 14

[PATCH] video: fbdev: replace snprintf in show functions with sysfs_emit

2021-10-12 Thread Qing Wang
coccicheck complains about the use of snprintf() in sysfs show functions. Fix the coccicheck warning: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang --- drivers/video/fbdev/core/fbsysfs.c | 14 +++--- 1 file