* [PATCH] drm/amd/display: remove redundant check
@ 2023-10-30 17:04 José Pekkarinen
2023-10-30 17:11 ` kernel test robot
0 siblings, 1 reply; 9+ messages in thread
From: José Pekkarinen @ 2023-10-30 17:04 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan
Cc: José Pekkarinen, alexander.deucher, christian.koenig,
Xinhui.Pan, airlied, daniel, dillon.varone, Jun.Lei,
aurabindo.pillai, george.shen, samson.tam, SyedSaaem.Rizvi,
stable, dri-devel, linux-kernel, linux-kernel-mentees
This patch addresses the following warning spotted by
using coccinelle where the case checked does the same
than the else case.
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10: WARNING: possible condition with no effect (if == else)
Fixes: 974ce181 ("drm/amd/display: Add check for PState change in DCN32")
Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi>
---
.../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
index ecea008f19d3..d940dfa5ae43 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
@@ -4661,10 +4661,6 @@ void dml32_CalculateMinAndMaxPrefetchMode(
} else if (AllowForPStateChangeOrStutterInVBlankFinal == dm_prefetch_support_uclk_fclk_and_stutter) {
*MinPrefetchMode = 0;
*MaxPrefetchMode = 0;
- } else if (AllowForPStateChangeOrStutterInVBlankFinal ==
- dm_prefetch_support_uclk_fclk_and_stutter_if_possible) {
- *MinPrefetchMode = 0;
- *MaxPrefetchMode = 3;
} else {
*MinPrefetchMode = 0;
*MaxPrefetchMode = 3;
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH] drm/amd/display: remove redundant check
@ 2023-10-30 17:17 José Pekkarinen
2023-10-30 17:39 ` Aurabindo Pillai
2023-10-31 5:48 ` Greg KH
0 siblings, 2 replies; 9+ messages in thread
From: José Pekkarinen @ 2023-10-30 17:17 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan
Cc: José Pekkarinen, alexander.deucher, christian.koenig,
Xinhui.Pan, airlied, daniel, dillon.varone, Jun.Lei,
aurabindo.pillai, george.shen, samson.tam, SyedSaaem.Rizvi,
stable, dri-devel, linux-kernel, linux-kernel-mentees
This patch addresses the following warning spotted by
using coccinelle where the case checked does the same
than the else case.
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10: WARNING: possible condition with no effect (if == else)
Fixes: 974ce181 ("drm/amd/display: Add check for PState change in DCN32")
Cc: stable@vger.kernel.org
Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi>
---
.../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
index ecea008f19d3..d940dfa5ae43 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
@@ -4661,10 +4661,6 @@ void dml32_CalculateMinAndMaxPrefetchMode(
} else if (AllowForPStateChangeOrStutterInVBlankFinal == dm_prefetch_support_uclk_fclk_and_stutter) {
*MinPrefetchMode = 0;
*MaxPrefetchMode = 0;
- } else if (AllowForPStateChangeOrStutterInVBlankFinal ==
- dm_prefetch_support_uclk_fclk_and_stutter_if_possible) {
- *MinPrefetchMode = 0;
- *MaxPrefetchMode = 3;
} else {
*MinPrefetchMode = 0;
*MaxPrefetchMode = 3;
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-30 17:17 José Pekkarinen
@ 2023-10-30 17:39 ` Aurabindo Pillai
2023-10-31 5:48 ` Greg KH
1 sibling, 0 replies; 9+ messages in thread
From: Aurabindo Pillai @ 2023-10-30 17:39 UTC (permalink / raw)
To: José Pekkarinen, harry.wentland, sunpeng.li,
Rodrigo.Siqueira, skhan
Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
dillon.varone, Jun.Lei, george.shen, samson.tam, SyedSaaem.Rizvi,
stable, dri-devel, linux-kernel, linux-kernel-mentees
On 2023-10-30 13:17, José Pekkarinen wrote:
> This patch addresses the following warning spotted by
> using coccinelle where the case checked does the same
> than the else case.
>
> drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10: WARNING: possible condition with no effect (if == else)
>
> Fixes: 974ce181 ("drm/amd/display: Add check for PState change in DCN32")
>
> Cc: stable@vger.kernel.org
> Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi>
> ---
> .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
> index ecea008f19d3..d940dfa5ae43 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
> @@ -4661,10 +4661,6 @@ void dml32_CalculateMinAndMaxPrefetchMode(
> } else if (AllowForPStateChangeOrStutterInVBlankFinal == dm_prefetch_support_uclk_fclk_and_stutter) {
> *MinPrefetchMode = 0;
> *MaxPrefetchMode = 0;
> - } else if (AllowForPStateChangeOrStutterInVBlankFinal ==
> - dm_prefetch_support_uclk_fclk_and_stutter_if_possible) {
> - *MinPrefetchMode = 0;
> - *MaxPrefetchMode = 3;
> } else {
> *MinPrefetchMode = 0;
> *MaxPrefetchMode = 3;
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-30 17:17 José Pekkarinen
2023-10-30 17:39 ` Aurabindo Pillai
@ 2023-10-31 5:48 ` Greg KH
2023-10-31 11:42 ` José Pekkarinen
1 sibling, 1 reply; 9+ messages in thread
From: Greg KH @ 2023-10-31 5:48 UTC (permalink / raw)
To: José Pekkarinen
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan,
dillon.varone, linux-kernel-mentees, dri-devel, Xinhui.Pan,
linux-kernel, samson.tam, SyedSaaem.Rizvi, aurabindo.pillai,
stable, daniel, george.shen, alexander.deucher, Jun.Lei, airlied,
christian.koenig
On Mon, Oct 30, 2023 at 07:17:48PM +0200, José Pekkarinen wrote:
> This patch addresses the following warning spotted by
> using coccinelle where the case checked does the same
> than the else case.
>
> drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10: WARNING: possible condition with no effect (if == else)
>
> Fixes: 974ce181 ("drm/amd/display: Add check for PState change in DCN32")
>
> Cc: stable@vger.kernel.org
Why is this relevant for stable?
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-31 5:48 ` Greg KH
@ 2023-10-31 11:42 ` José Pekkarinen
2023-10-31 12:20 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: José Pekkarinen @ 2023-10-31 11:42 UTC (permalink / raw)
To: Greg KH
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan,
dillon.varone, linux-kernel-mentees, dri-devel, Xinhui.Pan,
linux-kernel, samson.tam, SyedSaaem.Rizvi, aurabindo.pillai,
stable, daniel, george.shen, alexander.deucher, Jun.Lei, airlied,
christian.koenig
On 2023-10-31 07:48, Greg KH wrote:
> On Mon, Oct 30, 2023 at 07:17:48PM +0200, José Pekkarinen wrote:
>> This patch addresses the following warning spotted by
>> using coccinelle where the case checked does the same
>> than the else case.
>>
>> drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10:
>> WARNING: possible condition with no effect (if == else)
>>
>> Fixes: 974ce181 ("drm/amd/display: Add check for PState change in
>> DCN32")
>>
>> Cc: stable@vger.kernel.org
>
> Why is this relevant for stable?
Hi,
I was asked to send it for stable because this code
looks different in amd-staging-drm-next, see here.
https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c#L4661
Feel free to let me know if this is wrong, or if I
need to review some other guidelines I may have missed.
Thanks!
José.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-31 11:42 ` José Pekkarinen
@ 2023-10-31 12:20 ` Greg KH
2023-10-31 12:32 ` José Pekkarinen
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2023-10-31 12:20 UTC (permalink / raw)
To: José Pekkarinen
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan,
dillon.varone, linux-kernel-mentees, dri-devel, Xinhui.Pan,
linux-kernel, samson.tam, SyedSaaem.Rizvi, aurabindo.pillai,
stable, daniel, george.shen, alexander.deucher, Jun.Lei, airlied,
christian.koenig
On Tue, Oct 31, 2023 at 01:42:17PM +0200, José Pekkarinen wrote:
> On 2023-10-31 07:48, Greg KH wrote:
> > On Mon, Oct 30, 2023 at 07:17:48PM +0200, José Pekkarinen wrote:
> > > This patch addresses the following warning spotted by
> > > using coccinelle where the case checked does the same
> > > than the else case.
> > >
> > > drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10:
> > > WARNING: possible condition with no effect (if == else)
> > >
> > > Fixes: 974ce181 ("drm/amd/display: Add check for PState change in
> > > DCN32")
> > >
> > > Cc: stable@vger.kernel.org
> >
> > Why is this relevant for stable?
>
> Hi,
>
> I was asked to send it for stable because this code
> looks different in amd-staging-drm-next, see here.
>
> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c#L4661
I don't know what I am looking at, sorry.
> Feel free to let me know if this is wrong, or if I
> need to review some other guidelines I may have missed.
Please see the list of rules for stable patches:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Does "remove code that does nothing" fit here?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-31 12:20 ` Greg KH
@ 2023-10-31 12:32 ` José Pekkarinen
2023-10-31 16:41 ` Aurabindo Pillai
0 siblings, 1 reply; 9+ messages in thread
From: José Pekkarinen @ 2023-10-31 12:32 UTC (permalink / raw)
To: Greg KH
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan,
dillon.varone, linux-kernel-mentees, dri-devel, Xinhui.Pan,
linux-kernel, samson.tam, SyedSaaem.Rizvi, aurabindo.pillai,
stable, daniel, george.shen, alexander.deucher, Jun.Lei, airlied,
christian.koenig
On 2023-10-31 14:20, Greg KH wrote:
> On Tue, Oct 31, 2023 at 01:42:17PM +0200, José Pekkarinen wrote:
>> On 2023-10-31 07:48, Greg KH wrote:
>> > On Mon, Oct 30, 2023 at 07:17:48PM +0200, José Pekkarinen wrote:
>> > > This patch addresses the following warning spotted by
>> > > using coccinelle where the case checked does the same
>> > > than the else case.
>> > >
>> > > drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10:
>> > > WARNING: possible condition with no effect (if == else)
>> > >
>> > > Fixes: 974ce181 ("drm/amd/display: Add check for PState change in
>> > > DCN32")
>> > >
>> > > Cc: stable@vger.kernel.org
>> >
>> > Why is this relevant for stable?
>>
>> Hi,
>>
>> I was asked to send it for stable because this code
>> looks different in amd-staging-drm-next, see here.
>>
>> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c#L4661
>
> I don't know what I am looking at, sorry.
>
>> Feel free to let me know if this is wrong, or if I
>> need to review some other guidelines I may have missed.
>
> Please see the list of rules for stable patches:
>
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>
> Does "remove code that does nothing" fit here?
Yep, it is a trivial fix which compilers should be able
to optimize, so no real benefit to the user. Sorry Greg!
José.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/amd/display: remove redundant check
2023-10-31 12:32 ` José Pekkarinen
@ 2023-10-31 16:41 ` Aurabindo Pillai
0 siblings, 0 replies; 9+ messages in thread
From: Aurabindo Pillai @ 2023-10-31 16:41 UTC (permalink / raw)
To: José Pekkarinen, Greg KH
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, skhan,
dillon.varone, linux-kernel-mentees, dri-devel, Xinhui.Pan,
linux-kernel, samson.tam, SyedSaaem.Rizvi, stable, daniel,
george.shen, alexander.deucher, Jun.Lei, airlied,
christian.koenig
On 2023-10-31 08:32, José Pekkarinen wrote:
> On 2023-10-31 14:20, Greg KH wrote:
>> On Tue, Oct 31, 2023 at 01:42:17PM +0200, José Pekkarinen wrote:
>>> On 2023-10-31 07:48, Greg KH wrote:
>>> > On Mon, Oct 30, 2023 at 07:17:48PM +0200, José Pekkarinen wrote:
>>> > > This patch addresses the following warning spotted by
>>> > > using coccinelle where the case checked does the same
>>> > > than the else case.
>>> > >
>>> > >
>>> drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10:
>>> > > WARNING: possible condition with no effect (if == else)
>>> > >
>>> > > Fixes: 974ce181 ("drm/amd/display: Add check for PState change in
>>> > > DCN32")
>>> > >
>>> > > Cc: stable@vger.kernel.org
>>> >
>>> > Why is this relevant for stable?
>>>
>>> Hi,
>>>
>>> I was asked to send it for stable because this code
>>> looks different in amd-staging-drm-next, see here.
>>>
>>> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c#L4661
>>
>> I don't know what I am looking at, sorry.
>>
>>> Feel free to let me know if this is wrong, or if I
>>> need to review some other guidelines I may have missed.
>>
>> Please see the list of rules for stable patches:
>> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>>
>> Does "remove code that does nothing" fit here?
>
> Yep, it is a trivial fix which compilers should be able
> to optimize, so no real benefit to the user. Sorry Greg!
>
> José.
Hi Greg,
Sorry, I asked José to send it to stable because I realized the patch
listed in the fixes tag wasnt quite needed on stable. Patch from José
effectively removes it.
I hope that clears the context. But there is no impact whether you apply
José's patch or not, so we're good either way.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-10-31 16:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30 17:04 [PATCH] drm/amd/display: remove redundant check José Pekkarinen
2023-10-30 17:11 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2023-10-30 17:17 José Pekkarinen
2023-10-30 17:39 ` Aurabindo Pillai
2023-10-31 5:48 ` Greg KH
2023-10-31 11:42 ` José Pekkarinen
2023-10-31 12:20 ` Greg KH
2023-10-31 12:32 ` José Pekkarinen
2023-10-31 16:41 ` Aurabindo Pillai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox