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

2016-09-08 Thread Huang Rui
On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: > On Wed, Sep 07, 2016 at 10:07:57PM -0400, 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 firs

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

2016-09-08 Thread Christian König
Am 08.09.2016 um 09:35 schrieb Chris Wilson: > On Thu, Sep 08, 2016 at 03:22:48PM +0800, Huang Rui wrote: >> On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: >>> On Wed, Sep 07, 2016 at 10:07:57PM -0400, Huang Rui wrote: In previous drm_global_item_ref, there are two times of writ

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

2016-09-08 Thread Christian König
Am 08.09.2016 um 04:07 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

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

2016-09-08 Thread Chris Wilson
On Thu, Sep 08, 2016 at 09:43:52AM +0200, Christian König wrote: > Am 08.09.2016 um 09:35 schrieb Chris Wilson: > >On Thu, Sep 08, 2016 at 03:22:48PM +0800, Huang Rui wrote: > >>On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: > >>>On Wed, Sep 07, 2016 at 10:07:57PM -0400, Huang Rui w

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

2016-09-08 Thread Chris Wilson
On Thu, Sep 08, 2016 at 03:22:48PM +0800, Huang Rui wrote: > On Thu, Sep 08, 2016 at 02:36:06PM +0800, Chris Wilson wrote: > > On Wed, Sep 07, 2016 at 10:07:57PM -0400, Huang Rui wrote: > > > In previous drm_global_item_ref, there are two times of writing > > > ref->object if item->refcount is 0. S

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

2016-09-08 Thread Chris Wilson
On Wed, Sep 07, 2016 at 10:07:57PM -0400, 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

[PATCH v3] 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