[U-Boot] [PATCH] video: ipu: simplify if else code

Stefano Babic sbabic at denx.de
Tue Nov 24 10:55:33 CET 2015


On 24/11/2015 09:54, Peng Fan wrote:
> Simplify if/else code, since if channel equals to MEM_BG_SYNC or
> MEM_FG_SYNC, we have value 5 for 'dc_chan'.
> 
> Signed-off-by: Peng Fan <Peng.Fan at freescale.com>
> Cc: Anatolij Gustschin <agust at denx.de>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
>  drivers/video/ipu_disp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/video/ipu_disp.c b/drivers/video/ipu_disp.c
> index 4faeafb..7a87478 100644
> --- a/drivers/video/ipu_disp.c
> +++ b/drivers/video/ipu_disp.c
> @@ -611,11 +611,9 @@ void ipu_dp_dc_enable(ipu_channel_t channel)
>  	uint32_t reg;
>  	uint32_t dc_chan;
>  
> -	if (channel == MEM_FG_SYNC)
> -		dc_chan = 5;
>  	if (channel == MEM_DC_SYNC)
>  		dc_chan = 1;
> -	else if (channel == MEM_BG_SYNC)
> +	else if ((channel == MEM_BG_SYNC) || (channel == MEM_FG_SYNC))
>  		dc_chan = 5;
>  	else
>  		return;
> 

Reviewed-by: Stefano Babic <sbabic at denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list