[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTil_Pu76aEje-5FP9nmxba--pmmAX3YkqNdzN3xX@mail.gmail.com>
Date: Tue, 6 Jul 2010 12:12:11 -0500
From: Aldo Cedillo <aldobrett11@...il.com>
To: kagen101@...il.com
Cc: gregkh@...e.de, mchehab@...hat.com, olimpiu.pascariu@...il.com,
julia@...u.dk, tj@...nel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: cx25821: fix brace coding style issue in
cx25821-audio-upstream.c
> Subject: [PATCH] Staging: cx25821: fix brace coding style issue in cx25821-audio-upstream.c
> This is a patch to the cx25821.c file that fixes up a brace warning found by the checkpatch.pl tool
> Signed-off-by: Joe Eloff <kagen101@...il.com>
>
> ---
> drivers/staging/cx25821/cx25821-audio-upstream.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c b/drivers/staging/cx25821/cx25821-audio-upstream.c
> index eb39d13..e7346ec 100644
> --- a/drivers/staging/cx25821/cx25821-audio-upstream.c
> +++ b/drivers/staging/cx25821/cx25821-audio-upstream.c
> @@ -762,9 +762,9 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
> str_length + 1);
I haven't tried checkpatch.pl over that file, but in the CodingStyle
document you can read this:
Do not unnecessarily use braces where a single statement will do.
if (condition)
action();
This does not apply if one branch of a conditional statement is a single
statement. Use braces in both branches.
if (condition) {
do_this();
do_that();
} else {
otherwise();
}
Which one is the correct style? I ask these because I have seen this
in other parts of the kernel. So maybe I can help to homogenize this.
> /* Default if filename is empty string */
> - if (strcmp(dev->input_audiofilename, "") == 0) {
> + if (strcmp(dev->input_audiofilename, "") == 0)
> dev->_audiofilename = "/root/audioGOOD.wav";
> - }
I believe only this one has to go.
> +
> } else {
So the first brace closes the brace of the if line.
> str_length = strlen(_defaultAudioName);
> dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
Thanks,
Aldo Brett
--
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