lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 14 Aug 2011 09:38:26 -0700
From:	Joe Perches <joe@...ches.com>
To:	"Leonid V. Fedorenchik" <leonidsbox@...il.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Ruslan Pisarev <ruslan@...sarev.org.ua>,
	Ilia Mirkin <imirkin@...m.mit.edu>,
	Ilya Gorskin <Revent82@...il.com>,
	devel@...uxdriverproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] Staging: cx25821: fix style issues in
 cx25821-video-upstream-ch2

On Sun, 2011-08-14 at 19:42 +0800, Leonid V. Fedorenchik wrote:
> Fix long lines in files cx25821-video-upstream-ch2.{c,h}
> Change obscure line endings to less obscure ones.
> Delete whitespace characters before labels.
[]
> diff --git a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
> index 655357d..b578e46 100644
> --- a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
> +++ b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
> @@ -151,9 +151,8 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,
[]
> -		frame_size =
> -		    (bpl ==
> -		     Y411_LINE_SZ) ? FRAME_SIZE_PAL_Y411 : FRAME_SIZE_PAL_Y422;
> +		frame_size = (bpl == Y411_LINE_SZ) ? FRAME_SIZE_PAL_Y411 :
> +						FRAME_SIZE_PAL_Y422;

I think this becomes more readable without the ?: as:

		if (bpl == Y411_LINE_SZ)
			frame_size = FRAME_SIZE_PAL_Y411;
		else
			frame_size = FRAME_SIZE_PAL_Y422;

> @@ -565,23 +556,18 @@ int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num,
>  			}
>  
>  			if (dev->_dma_virt_start_addr_ch2 != NULL) {
> -				line_size_in_bytes =
> -				    (dev->_pixel_format_ch2 ==
> -				     PIXEL_FRMT_411) ? Y411_LINE_SZ :
> -				    Y422_LINE_SZ;
> +				line_size_in_bytes = (dev->_pixel_format_ch2 ==
> +						PIXEL_FRMT_411) ? Y411_LINE_SZ :
> +						Y422_LINE_SZ;

no ?: here too.

> diff --git a/drivers/staging/cx25821/cx25821-video-upstream-ch2.h b/drivers/staging/cx25821/cx25821-video-upstream-ch2.h
[]
> @@ -65,37 +65,61 @@
>  #define USE_RISC_NOOP_VIDEO   1
>  
>  #ifdef USE_RISC_NOOP_VIDEO
> -#define PAL_US_VID_PROG_SIZE      ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE +   \
> -				    RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE)
> +#define PAL_US_VID_PROG_SIZE      ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + \
> +	RISC_WRITECR_INSTRUCTION_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \
> +	NUM_NO_OPS*DWORD_SIZE)

These multi line macros might be more readable and consistent
if indented identically.

#define PAL_US_VID_PROG_SIZE						\
	(PAL_FIELD_HEIGHT * 3 * DWORD_SIZE +				\
	 RISC_WRITECR_INSTRUCTION_SIZE + RISC_SYNC_INSTRUCTION_SIZE +	\
	 NUM_NO_OPS * DWORD_SIZE)

PAL_FIELD_HEIGHT does not needs parentheses here.

[]
> +#define PAL_VID_PROG_SIZE         ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + \
> +	2*RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
> +	JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE)

#define PAL_VID_PROG_SIZE						\
	((PAL_FIELD_HEIGHT * 2) * 3 * DWORD_SIZE +			\
	 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
	 JUMP_INSTRUCTION_SIZE + 2 * NUM_NO_OPS * DWORD_SIZE)
 
> +#define ODD_FLD_PAL_PROG_SIZE     ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + \
> +	RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \
> +	NUM_NO_OPS*DWORD_SIZE)

etc...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ