From: Joe Perches <joe@perches.com>
To: Janakarajan Natarajan <janakarajann@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Marek Belisko <marek.belisko@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Drivers: Staging: ft1000: checkpatch warning fixes
Date: Wed, 11 Mar 2015 14:21:38 -0700 [thread overview]
Message-ID: <1426108898.32696.67.camel@perches.com> (raw)
In-Reply-To: <1426107804-54961-1-git-send-email-janakarajann@gmail.com>
On Wed, 2015-03-11 at 14:03 -0700, Janakarajan Natarajan wrote:
> Addition of blank line after declaration in ft1000_hw.c
> Minor changes to remove {} from single line if and remove extra parenthesis.
> Fixes checkpatch warning for <asm/bitops.h> and <asm/io.h> usage.
Most prefer separate patches for each type of change,
so this single patch could be 3 patches.
> diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
and for more trivia:
> @@ -1948,11 +1948,11 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
> ft1000_read_reg(dev,
> FT1000_REG_MAG_DFSR);
> }
> - if (tempword & 0x1f) {
> + if (tempword & 0x1f)
> ft1000_copy_up_pkt(dev);
> - } else {
> + else
> break;
> - }
> +
> cnt++;
> } while (cnt < MAX_RCV_LOOP);
do {
if (foo)
bar;
else
break;
} while (baz);
is generally better written
do {
if (!foo)
break;
bar;
} while (baz);
so
if (!(tempword & 0x1f))
break;
ft100_copy_up_pkt(dev);
cnt++;
} while (cnt < MAX_RCV_LOOP);
or maybe
if (!(tempword & 0x1f))
break;
ft100_copy_up_pkt(dev);
} while (++cnt < MAX_RCV_LOOP);
next prev parent reply other threads:[~2015-03-11 21:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 21:03 Janakarajan Natarajan
2015-03-11 21:20 ` Giedrius Statkevičius
2015-03-11 21:21 ` Joe Perches [this message]
2015-03-13 2:42 ` [PATCHv2 0/5] ft1000 driver checkpatch.pl fixes Janakarajan Natarajan
2015-03-13 2:42 ` [PATCHv2 1/5] Drivers: Staging: ft1000: Single line if-statement changes Janakarajan Natarajan
2015-03-13 2:42 ` [PATCHv2 2/5] Drivers: Staging: ft1000: Fix extra parenthesis warnings Janakarajan Natarajan
2015-03-13 2:42 ` [PATCHv2 3/5] Drivers: Staging: ft1000: Refactoring if-else statement Janakarajan Natarajan
2015-03-13 2:43 ` [PATCHv2 4/5] Drivers: Staging: ft1000: Fix blank line warning Janakarajan Natarajan
2015-03-13 2:43 ` [PATCHv2 5/5] Drivers: Staging: ft1000: checkpatch.pl header file warning fix Janakarajan Natarajan
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=1426108898.32696.67.camel@perches.com \
--to=joe@perches.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=janakarajann@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marek.belisko@gmail.com \
/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
Powered by JetHome