[PATCH] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-07 Thread Huang Rui
On Tue, Sep 06, 2016 at 10:33:18PM +0800, Sean Paul wrote: > On Mon, Sep 5, 2016 at 3:00 AM, Huang Rui wrote: > > 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

[PATCH] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-06 Thread Sean Paul
On Mon, Sep 5, 2016 at 3:00 AM, Huang Rui wrote: > 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

[PATCH] drm: modify drm_global_item_ref to avoid two times of writing ref->object

2016-09-05 Thread Huang Rui
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