]> git.baikalelectronics.ru Git - kernel.git/commit
drm: modify drm_global_item_ref to avoid two times of writing ref->object
authorHuang Rui <ray.huang@amd.com>
Wed, 7 Sep 2016 05:24:31 +0000 (13:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Sep 2016 19:10:29 +0000 (15:10 -0400)
commit7648ad785e3262997288adc3fa8db3169531b07f
tree0105b35dfdb417a38e55ef043204b80ecd2b972a
parent6f5a5c640a5a78701b122f73cc9deed2fa2c2dfe
drm: modify drm_global_item_ref to avoid two times of writing ref->object

In previous drm_global_item_ref, there are two times of writing
ref->object if item->refcount is 0. So this patch does a minor update
to put alloc and init ref firstly, and then to modify the item of glob
array. Use "else" to avoid two times of writing ref->object. It can
make the code logic more clearly.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_global.c