From: Joe Perches <joe@perches.com>
To: "Leonid V. Fedorenchik" <leonidsbox@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Ruslan Pisarev <ruslan@rpisarev.org.ua>,
Ilia Mirkin <imirkin@alum.mit.edu>,
Ilya Gorskin <Revent82@gmail.com>,
devel@linuxdriverproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Staging: cx25821: fix style issues in cx25821-video-upstream-ch2
Date: Sun, 14 Aug 2011 09:38:26 -0700 [thread overview]
Message-ID: <1313339906.1698.17.camel@Joe-Laptop> (raw)
In-Reply-To: <1313322144-9309-3-git-send-email-leonidsbox@gmail.com>
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...
next prev parent reply other threads:[~2011-08-14 16:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-14 11:42 [PATCH 0/3] Staging: cx25821: fix style issues Leonid V. Fedorenchik
2011-08-14 11:42 ` [PATCH 1/3] Staging: cx25821: fix style issues in cx25821-audio-upstream Leonid V. Fedorenchik
2011-08-14 11:42 ` [PATCH 2/3] Staging: cx25821: fix style issues in cx25821-video-upstream-ch2 Leonid V. Fedorenchik
2011-08-14 16:38 ` Joe Perches [this message]
2011-08-14 11:42 ` [PATCH 3/3] Staging: cx25821: fix style issues in cx25821-video-upstream Leonid V. Fedorenchik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313339906.1698.17.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=Revent82@gmail.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=imirkin@alum.mit.edu \
--cc=leonidsbox@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=ruslan@rpisarev.org.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox