From: "james qian wang (Arm Technology China)" Subject: Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done Date: Tue, 8 Oct 2019 08:06:33 +0000 Message-ID: <20191008080626.GA20953@jamwan02-TSP300> References: <20191004162156.325-1-colin.king@canonical.com> <20191004192720.7eiqdvsm2yv62svg@e110455-lin.cambridge.arm.com> <35232014-f65a-f7a1-99db-8ed91f610a77@canonical.com> <20191007132505.GV22609@kadam> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20191007132505.GV22609@kadam> Content-Language: en-US Content-ID: <280853445FFF80489C1A703653481D96@eurprd08.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org To: Dan Carpenter Cc: Colin Ian King , Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter , "dri-devel@lists.freedesktop.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" , nd List-Id: dri-devel@lists.freedesktop.org On Mon, Oct 07, 2019 at 04:25:05PM +0300, Dan Carpenter wrote: > On Fri, Oct 04, 2019 at 10:53:44PM +0100, Colin Ian King wrote: > > On 04/10/2019 20:27, Liviu Dudau wrote: > > > On Fri, Oct 04, 2019 at 05:21:56PM +0100, Colin King wrote: > > >> From: Colin Ian King > > >> > > >> The pointer disable_done is being initialized with a value that > > >> is never read and is being re-assigned a little later on. The > > >> assignment is redundant and hence can be removed. > > >=20 > > > Not really true, isn't it? The re-assignment is done under the condit= ion that > > > crtc->state->active is true. disable_done will be used regardless aft= er the if > > > block, so we can't skip this initialisation. > > >=20 > > > Not sure why Coverity flags this, but I would NAK this patch. > >=20 > > I'm patching against the driver from linux-next so I believe this is OK > > for that. I believe your statement is true against linux which does not > > have commit: > >=20 > > d6cb013579e743bc7bc5590ca35a1943f2b8f3c8 > > Author: Lowry Li (Arm Technology China) > > Date: Fri Sep 6 07:18:06 2019 +0000 > >=20 >=20 > It really does help reviewing patches when this is mentioned in the > commit message. >=20 > There is some debate about whether this should be mentioned as a Fixes > since it doesn't fix a bug. I initialy felt it shouldn't be, but now > I think enough people think it should be listed as Fixes that I must be > wrong. Either way, it's very useful information. >=20 > The other thing is that soon get_maintainer.pl will start CC'ing people > from the Fixes tag and right now Lowry Li is not CC'd so that's > unfortunate. >=20 > regards, > dan carpenter Hi Liviu: Colin's code is right. Following code I copied from linux-next, and I checked drm-misc, the code are same.=20 struct komeda_pipeline *slave =3D kcrtc->slave; //---- First initialization. struct completion *disable_done =3D &crtc->state->commit->flip_done= ; bool needs_phase2 =3D false; DRM_DEBUG_ATOMIC("CRTC%d_DISABLE: active_pipes: 0x%x, affected: 0x%= x\n", drm_crtc_index(crtc), old_st->active_pipes, old_st->affected_pipes); if (slave && has_bit(slave->id, old_st->active_pipes)) komeda_pipeline_disable(slave, old->state); if (has_bit(master->id, old_st->active_pipes)) needs_phase2 =3D komeda_pipeline_disable(master, old->state= ); //---- Secondary initialization. disable_done =3D (needs_phase2 || crtc->state->active) ? NULL : &crtc->state->commit->flip_done; //--- First using is here. /* wait phase 1 disable done */ komeda_crtc_flush_and_wait_for_flip_done(kcrtc, disable_done); So the first initialization with the delcaration is unnecessary. And I also checked our internal testing branch which actually doesn't have the first initialization. seems somethings wrong when lowry submit this to upstream. Hi Colin: Thanks for the fix. I'll push it to drm-misc-fixes Reviewed-by: James Qian Wang (Arm Technology China) Best Regards James