diff mbox

drm/amd/display: remove some unneeded code

Message ID 20171106114422.sd5zoah6k6eaww4e@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Nov. 6, 2017, 11:44 a.m. UTC
We assign "v_init = asic_blank_start;" a few lines earlier so there is
no need to do it again inside the if statements.  Also "v_init" is
unsigned so it can't be less than zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Christian König Nov. 6, 2017, 11:59 a.m. UTC | #1
Am 06.11.2017 um 12:44 schrieb Dan Carpenter:
> We assign "v_init = asic_blank_start;" a few lines earlier so there is
> no need to do it again inside the if statements.  Also "v_init" is
> unsigned so it can't be less than zero.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Christian König <christian.koenig@amd.com>

>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
> index 1994865d4351..c7333cdf1802 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
> @@ -236,13 +236,10 @@ static void tgn10_program_timing(
>   	if (tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT ||
>   		tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
>   		tg->dlg_otg_param.signal == SIGNAL_TYPE_EDP) {
> -		v_init = asic_blank_start;
>   		start_point = 1;
>   		if (patched_crtc_timing.flags.INTERLACE == 1)
>   			field_num = 1;
>   	}
> -	if (v_init < 0)
> -		v_init = 0;
>   	v_fp2 = 0;
>   	if (tg->dlg_otg_param.vstartup_start > asic_blank_end)
>   		v_fp2 = tg->dlg_otg_param.vstartup_start > asic_blank_end;
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher Nov. 6, 2017, 9:35 p.m. UTC | #2
On Mon, Nov 6, 2017 at 6:59 AM, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
> Am 06.11.2017 um 12:44 schrieb Dan Carpenter:
>>
>> We assign "v_init = asic_blank_start;" a few lines earlier so there is
>> no need to do it again inside the if statements.  Also "v_init" is
>> unsigned so it can't be less than zero.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>
> Acked-by: Christian König <christian.koenig@amd.com>
>

Applied.  thanks!

Alex

>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
>> b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
>> index 1994865d4351..c7333cdf1802 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
>> @@ -236,13 +236,10 @@ static void tgn10_program_timing(
>>         if (tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT ||
>>                 tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT_MST
>> ||
>>                 tg->dlg_otg_param.signal == SIGNAL_TYPE_EDP) {
>> -               v_init = asic_blank_start;
>>                 start_point = 1;
>>                 if (patched_crtc_timing.flags.INTERLACE == 1)
>>                         field_num = 1;
>>         }
>> -       if (v_init < 0)
>> -               v_init = 0;
>>         v_fp2 = 0;
>>         if (tg->dlg_otg_param.vstartup_start > asic_blank_end)
>>                 v_fp2 = tg->dlg_otg_param.vstartup_start > asic_blank_end;
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
index 1994865d4351..c7333cdf1802 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
@@ -236,13 +236,10 @@  static void tgn10_program_timing(
 	if (tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT ||
 		tg->dlg_otg_param.signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
 		tg->dlg_otg_param.signal == SIGNAL_TYPE_EDP) {
-		v_init = asic_blank_start;
 		start_point = 1;
 		if (patched_crtc_timing.flags.INTERLACE == 1)
 			field_num = 1;
 	}
-	if (v_init < 0)
-		v_init = 0;
 	v_fp2 = 0;
 	if (tg->dlg_otg_param.vstartup_start > asic_blank_end)
 		v_fp2 = tg->dlg_otg_param.vstartup_start > asic_blank_end;