[PATCH] drm/i915: use memdup_user_nul

2017-05-07 Thread Geliang Tang
Use memdup_user_nul() helper instead of open-coding to simplify the code. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_debugfs.c | 13 +++-- drivers/gpu/drm/i915/intel_pipe_crc.c | 13 +++-- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers

[PATCH] drm/i915/error: use rb_entry()

2017-01-20 Thread Geliang Tang
To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915

[PATCH] drm/nouveau/client: use rb_entry()

2017-01-20 Thread Geliang Tang
To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- drivers/gpu/drm/nouveau/nvkm/core/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu

[PATCH] drm/nouveau/dma: use rb_entry()

2016-12-20 Thread Geliang Tang
To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c b

[PATCH] drm/i915/debugfs: use rb_entry()

2016-12-19 Thread Geliang Tang
To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915

[PATCH] drm: mediatek: use ERR_CAST inlined function

2016-11-18 Thread Geliang Tang
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)). Signed-off-by: Geliang Tang --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index

[PATCH] drm/radeon: use list_move in radeon_vm_bo_update

2016-11-11 Thread Geliang Tang
Use list_move() instead of list_del() + list_add() to simplify the code. Signed-off-by: Geliang Tang --- drivers/gpu/drm/radeon/radeon_vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c index

[PATCH 1/5 v2] drm/i915: use hlist_for_each_entry

2016-01-18 Thread Geliang Tang
Use hlist_for_each_entry() instead of hlist_for_each() to simplify the code. Signed-off-by: Geliang Tang --- Changes in v2: - Keep head = &eb->buckets[handle & eb->and] --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-)

[PATCH 5/5] drm/radeon: use kobj_to_dev()

2016-01-13 Thread Geliang Tang
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 59abebd..460c8f2 100644 --- a

[PATCH 4/5] drm/amdgpu: use kobj_to_dev()

2016-01-13 Thread Geliang Tang
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 4386cba..7d8d84e 100644

[PATCH 3/5] drm/sysfs: use kobj_to_dev()

2016-01-13 Thread Geliang Tang
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/drm_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 0ca6410..d503f8e 100644 --- a/drivers/gpu/drm/drm_sysfs.c

[PATCH 2/5] drm/i915: use kobj_to_dev()

2016-01-13 Thread Geliang Tang
Use kobj_to_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_sysfs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index 37e3f0d..c6188dd 100644 --- a

[PATCH 1/5] drm/i915: use hlist_for_each_entry

2016-01-13 Thread Geliang Tang
Use hlist_for_each_entry() instead of hlist_for_each() to simplify the code. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm

[PATCH 2/9] drm/gma500: use to_pci_dev()

2015-12-27 Thread Geliang Tang
Use to_pci_dev() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/gma500/power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c index b6b135f..bea8578 100644 --- a/drivers/gpu/drm

[PATCH] drm/mm: use list_next_entry

2015-11-25 Thread Geliang Tang
To make the intention clearer, use list_next_entry instead of list_entry. Signed-off-by: Geliang Tang --- include/drm/drm_mm.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index a58cc6c..fc65118 100644 --- a/include/drm

[PATCH 2/7] drm/vmwgfx: fix a problematic usage of WARN_ON()

2015-11-25 Thread Geliang Tang
WARN_ON() takes a condition rather than a format string. This patch converted WARN_ON() to WARN() instead. Signed-off-by: Geliang Tang --- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu

[PATCH 1/7] drm/msm/mdp: fix a problematic usage of WARN_ON()

2015-11-25 Thread Geliang Tang
WARN_ON() takes a condition rather than a format string. This patch converted WARN_ON() to WARN() instead. Signed-off-by: Geliang Tang --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h b

[PATCH v2] drm/mm: rewrite drm_mm_for_each_hole

2015-11-21 Thread Geliang Tang
When backwards is 0, __drm_mm_for_each_hole is same as drm_mm_for_each_hole. So I rewrite drm_mm_for_each_hole by using __drm_mm_for_each_hole. Signed-off-by: Geliang Tang --- Changes in v2: - fix make htmldocs warning --- include/drm/drm_mm.h | 23 +-- 1 file changed, 9

[PATCH] drm/mm: rewrite drm_mm_for_each_hole

2015-11-21 Thread Geliang Tang
When backwards is 0, __drm_mm_for_each_hole is same as drm_mm_for_each_hole. So I rewrite drm_mm_for_each_hole by using __drm_mm_for_each_hole. Signed-off-by: Geliang Tang --- include/drm/drm_mm.h | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/drm

[PATCH 1/9] drm: fix trivial typos

2015-10-18 Thread Geliang Tang
s/regsiter/register/ Signed-off-by: Geliang Tang --- drivers/gpu/drm/amd/include/atombios.h | 2 +- drivers/gpu/drm/radeon/cayman_blit_shaders.c| 2 +- drivers/gpu/drm/radeon/evergreen_blit_shaders.c | 2 +- drivers/gpu/drm/radeon/r600_blit_shaders.c | 2 +- 4 files changed, 4

[patch] drm/i915: unlock on error in i915_ppgtt_info()

2015-10-02 Thread Geliang Tang
On Fri, Oct 02, 2015 at 06:14:22PM +0300, Dan Carpenter wrote: > We need to call intel_runtime_pm_put() and mutex_unlock() before > returning. > > Fixes: 7cb5dff8d59d ('drm/i915: fix task reference leak in i915_debugfs.c') > Signed-off-by: Dan Carpenter Acked-by: Geliang Tang

[PATCH] drm/i915: fix compiler warnings in intel_audio.c

2015-09-30 Thread Geliang Tang
bool audio_rate_need_prog(struct intel_crtc *crtc, ^ Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/intel_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index baadd90..72d696b

[PATCH] drm/i915: fix task reference leak in i915_debugfs.c

2015-09-25 Thread Geliang Tang
Leak a task reference in i915_ppgtt_info(), add put_task_struct() to fix it. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_debugfs.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c

[PATCH] drm: drm_atomic_crtc_get_property should be static

2015-09-24 Thread Geliang Tang
Fixes the following sparse warning: drivers/gpu/drm/drm_atomic.c:442:5: warning: symbol 'drm_atomic_crtc_get_property' was not declared. Should it be static? Signed-off-by: Geliang Tang --- drivers/gpu/drm/drm_atomic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[PATCH 2/3] drm: fix kernel-doc warnings in drm_crtc.h

2015-09-16 Thread Geliang Tang
Fix the following 'make htmldocs' warning: .//include/drm/drm_crtc.h:929: warning: Excess struct/union/enum/typedef member 'base' description in 'drm_bridge' Signed-off-by: Geliang Tang --- include/drm/drm_crtc.h | 1 - 1 file changed, 1 deletion(-) diff --

[PATCH] drm/i915: fix kernel-doc warnings in intel_audio.c

2015-09-15 Thread Geliang Tang
l_audio_codec_disable' .//drivers/gpu/drm/i915/intel_audio.c:439: warning: No description found for parameter 'intel_encoder' .//drivers/gpu/drm/i915/intel_audio.c:439: warning: Excess function parameter 'encoder' description in 'intel_audio_codec_disable' Si

[PATCH] drm/i915: fix kernel-doc warnings in i915_gem.c

2015-09-15 Thread Geliang Tang
5/i915_gem.c:4962: warning: No description found for parameter 'old' .//drivers/gpu/drm/i915/i915_gem.c:4962: warning: No description found for parameter 'new' .//drivers/gpu/drm/i915/i915_gem.c:4962: warning: No description found for parameter 'frontbuffer_bits' Signe

[PATCH] drm/i915: fix kernel-doc warnings in i915_gem_gtt.c

2015-09-15 Thread Geliang Tang
27;length' .//drivers/gpu/drm/i915/i915_gem_gtt.c:818: warning: No description found for parameter 'new_pds' Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_gem_gtt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.

[PATCH] drm/i915: fix kernel-doc warnings in intel_lrc.c

2015-09-15 Thread Geliang Tang
ng_begin' .//drivers/gpu/drm/i915/intel_lrc.c:780: warning: Excess function parameter 'ctx' description in 'intel_logical_ring_begin' Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/intel_lrc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --g