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

2016-09-07 Thread Huang Rui
On Wed, Sep 07, 2016 at 04:02:47PM +0800, Koenig, Christian wrote: > Am 07.09.2016 um 09:54 schrieb Huang Rui: > > On Wed, Sep 07, 2016 at 09:12:29AM +0200, Christian K?nig wrote: > >> Am 07.09.2016 um 07:24 schrieb Huang Rui: snip. > >>> ++item->refcount; > >>> - ref->object = item->ob

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

2016-09-07 Thread Huang Rui
On Wed, Sep 07, 2016 at 09:12:29AM +0200, Christian König wrote: > Am 07.09.2016 um 07:24 schrieb 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

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

2016-09-07 Thread Christian König
Am 07.09.2016 um 09:54 schrieb Huang Rui: > On Wed, Sep 07, 2016 at 09:12:29AM +0200, Christian König wrote: >> Am 07.09.2016 um 07:24 schrieb 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 >>

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

2016-09-07 Thread Christian König
Am 07.09.2016 um 07:24 schrieb 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 writ

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

2016-09-07 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 c