Re: [PATCH] imx-drm: imx-hdmi: Remove parentheses from returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 05, 2014 at 06:36:42PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> 

Don't use the From: header.  It is for maintainers sending patches on
behalf of other people.  Figure out how to send emails from within
freescale.  That way we can do a minimum of verifying that your
signed-off-by matches your email "From" header.

> Fix the following checkpatch warnings:
> 
> ERROR: return is not a function, parentheses are not required
> #462: FILE: drivers/staging/imx-drm/imx-hdmi.c:462:
> +	return (hdmi->hdmi_data.enc_in_format !=
> 
> ERROR: return is not a function, parentheses are not required
> #468: FILE: drivers/staging/imx-drm/imx-hdmi.c:468:
> +	return ((hdmi->hdmi_data.enc_out_format == YCBCR422_8BITS) &&
> 
> ERROR: return is not a function, parentheses are not required
> #475: FILE: drivers/staging/imx-drm/imx-hdmi.c:475:
> +	return ((hdmi->hdmi_data.enc_in_format == YCBCR422_8BITS) &&
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  drivers/staging/imx-drm/imx-hdmi.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c
> index 62ce0e8..8c15e07 100644
> --- a/drivers/staging/imx-drm/imx-hdmi.c
> +++ b/drivers/staging/imx-drm/imx-hdmi.c
> @@ -459,22 +459,22 @@ static void hdmi_video_sample(struct imx_hdmi *hdmi)
>  
>  static int is_color_space_conversion(struct imx_hdmi *hdmi)
>  {
> -	return (hdmi->hdmi_data.enc_in_format !=
> -		hdmi->hdmi_data.enc_out_format);
> +	return hdmi->hdmi_data.enc_in_format !=
> +		hdmi->hdmi_data.enc_out_format;

Use spaces to align these so the 'h' characters are on the same column.

	return hdmi->hdmi_data.enc_in_format !=
	       hdmi->hdmi_data.enc_out_format;

Actually, it now fits on one line:

	return hdmi->hdmi_data.enc_in_format != hdmi->hdmi_data.enc_out_format;

>  }
>  
>  static int is_color_space_decimation(struct imx_hdmi *hdmi)
>  {
> -	return ((hdmi->hdmi_data.enc_out_format == YCBCR422_8BITS) &&
> +	return (hdmi->hdmi_data.enc_out_format == YCBCR422_8BITS) &&
>  		(hdmi->hdmi_data.enc_in_format == RGB ||
> -		hdmi->hdmi_data.enc_in_format == YCBCR444));
> +		hdmi->hdmi_data.enc_in_format == YCBCR444);

This code would clearer if it were aligned properly using spaces:

	return hdmi->hdmi_data.enc_out_format == YCBCR422_8BITS &&
	       (hdmi->hdmi_data.enc_in_format == RGB ||
	        hdmi->hdmi_data.enc_in_format == YCBCR444);


But really it would be more clear if we broke it up:

	if (hdmi->hdmi_data.enc_out_format != YCBCR422_8BITS)
		return 0;
	if (hdmi->hdmi_data.enc_in_format == RGB ||
	    hdmi->hdmi_data.enc_in_format == YCBCR444)
		return 1;
	return 0;

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux