* [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done
@ 2019-10-04 16:21 Colin King
2019-10-04 19:27 ` Liviu Dudau
0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2019-10-04 16:21 UTC (permalink / raw)
To: James Wang, Liviu Dudau, Brian Starkey, David Airlie,
Daniel Vetter, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 75263d8cd0bd..9beeda04818b 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -296,7 +296,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc,
struct komeda_crtc_state *old_st = to_kcrtc_st(old);
struct komeda_pipeline *master = kcrtc->master;
struct komeda_pipeline *slave = kcrtc->slave;
- struct completion *disable_done = &crtc->state->commit->flip_done;
+ struct completion *disable_done;
bool needs_phase2 = false;
DRM_DEBUG_ATOMIC("CRTC%d_DISABLE: active_pipes: 0x%x, affected: 0x%x\n",
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done
2019-10-04 16:21 [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done Colin King
@ 2019-10-04 19:27 ` Liviu Dudau
2019-10-04 21:53 ` Colin Ian King
0 siblings, 1 reply; 5+ messages in thread
From: Liviu Dudau @ 2019-10-04 19:27 UTC (permalink / raw)
To: Colin King
Cc: James Wang, Brian Starkey, David Airlie, Daniel Vetter,
dri-devel, kernel-janitors, linux-kernel
On Fri, Oct 04, 2019 at 05:21:56PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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.
Not really true, isn't it? The re-assignment is done under the condition that
crtc->state->active is true. disable_done will be used regardless after the if
block, so we can't skip this initialisation.
Not sure why Coverity flags this, but I would NAK this patch.
Best regards,
Liviu
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> index 75263d8cd0bd..9beeda04818b 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> @@ -296,7 +296,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc,
> struct komeda_crtc_state *old_st = to_kcrtc_st(old);
> struct komeda_pipeline *master = kcrtc->master;
> struct komeda_pipeline *slave = kcrtc->slave;
> - struct completion *disable_done = &crtc->state->commit->flip_done;
> + struct completion *disable_done;
> bool needs_phase2 = false;
>
> DRM_DEBUG_ATOMIC("CRTC%d_DISABLE: active_pipes: 0x%x, affected: 0x%x\n",
> --
> 2.20.1
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done
2019-10-04 19:27 ` Liviu Dudau
@ 2019-10-04 21:53 ` Colin Ian King
2019-10-07 13:25 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Colin Ian King @ 2019-10-04 21:53 UTC (permalink / raw)
To: Liviu Dudau
Cc: James Wang, Brian Starkey, David Airlie, Daniel Vetter,
dri-devel, kernel-janitors, linux-kernel
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 <colin.king@canonical.com>
>>
>> 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.
>
> Not really true, isn't it? The re-assignment is done under the condition that
> crtc->state->active is true. disable_done will be used regardless after the if
> block, so we can't skip this initialisation.
>
> Not sure why Coverity flags this, but I would NAK this patch.
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:
d6cb013579e743bc7bc5590ca35a1943f2b8f3c8
Author: Lowry Li (Arm Technology China) <Lowry.Li@arm.com>
Date: Fri Sep 6 07:18:06 2019 +0000
Colin.
>
> Best regards,
> Liviu
>
>>
>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
>> index 75263d8cd0bd..9beeda04818b 100644
>> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
>> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
>> @@ -296,7 +296,7 @@ komeda_crtc_atomic_disable(struct drm_crtc *crtc,
>> struct komeda_crtc_state *old_st = to_kcrtc_st(old);
>> struct komeda_pipeline *master = kcrtc->master;
>> struct komeda_pipeline *slave = kcrtc->slave;
>> - struct completion *disable_done = &crtc->state->commit->flip_done;
>> + struct completion *disable_done;
>> bool needs_phase2 = false;
>>
>> DRM_DEBUG_ATOMIC("CRTC%d_DISABLE: active_pipes: 0x%x, affected: 0x%x\n",
>> --
>> 2.20.1
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done
2019-10-04 21:53 ` Colin Ian King
@ 2019-10-07 13:25 ` Dan Carpenter
2019-10-08 8:06 ` james qian wang (Arm Technology China)
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2019-10-07 13:25 UTC (permalink / raw)
To: Colin Ian King
Cc: Liviu Dudau, James Wang, Brian Starkey, David Airlie,
Daniel Vetter, dri-devel, kernel-janitors, linux-kernel
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 <colin.king@canonical.com>
> >>
> >> 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.
> >
> > Not really true, isn't it? The re-assignment is done under the condition that
> > crtc->state->active is true. disable_done will be used regardless after the if
> > block, so we can't skip this initialisation.
> >
> > Not sure why Coverity flags this, but I would NAK this patch.
>
> 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:
>
> d6cb013579e743bc7bc5590ca35a1943f2b8f3c8
> Author: Lowry Li (Arm Technology China) <Lowry.Li@arm.com>
> Date: Fri Sep 6 07:18:06 2019 +0000
>
It really does help reviewing patches when this is mentioned in the
commit message.
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.
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.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done
2019-10-07 13:25 ` Dan Carpenter
@ 2019-10-08 8:06 ` james qian wang (Arm Technology China)
0 siblings, 0 replies; 5+ messages in thread
From: james qian wang (Arm Technology China) @ 2019-10-08 8:06 UTC (permalink / raw)
To: Dan Carpenter
Cc: Colin Ian King, Liviu Dudau, Brian Starkey, David Airlie,
Daniel Vetter, dri-devel, kernel-janitors, linux-kernel, nd
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 <colin.king@canonical.com>
> > >>
> > >> 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.
> > >
> > > Not really true, isn't it? The re-assignment is done under the condition that
> > > crtc->state->active is true. disable_done will be used regardless after the if
> > > block, so we can't skip this initialisation.
> > >
> > > Not sure why Coverity flags this, but I would NAK this patch.
> >
> > 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:
> >
> > d6cb013579e743bc7bc5590ca35a1943f2b8f3c8
> > Author: Lowry Li (Arm Technology China) <Lowry.Li@arm.com>
> > Date: Fri Sep 6 07:18:06 2019 +0000
> >
>
> It really does help reviewing patches when this is mentioned in the
> commit message.
>
> 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.
>
> 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.
>
> 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.
struct komeda_pipeline *slave = kcrtc->slave;
//---- First initialization.
struct completion *disable_done = &crtc->state->commit->flip_done;
bool needs_phase2 = 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 = komeda_pipeline_disable(master, old->state);
//---- Secondary initialization.
disable_done = (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) <james.qian.wang@arm.com>
Best Regards
James
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-08 8:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 16:21 [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done Colin King
2019-10-04 19:27 ` Liviu Dudau
2019-10-04 21:53 ` Colin Ian King
2019-10-07 13:25 ` Dan Carpenter
2019-10-08 8:06 ` james qian wang (Arm Technology China)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).