public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Shiva Kerdel <shiva@exdev.nl>, gregkh@linuxfoundation.org
Cc: wsa+renesas@sang-engineering.com, p.hoefflin@posteo.de,
	karniksayli1995@gmail.com, sabitha.george@gmail.com,
	georgiana.chelu93@gmail.com, goudapatilk@gmail.com,
	mihaela.muraru21@gmail.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: ks7010: ks_*: Braces should be used on all arms of these statements
Date: Fri, 17 Feb 2017 14:50:48 -0800	[thread overview]
Message-ID: <1487371848.2198.6.camel@perches.com> (raw)
In-Reply-To: <20170217214154.2792-1-shiva@exdev.nl>

On Fri, 2017-02-17 at 22:41 +0100, Shiva Kerdel wrote:
> Braces should be used on all arms of these statements (CHECK)..
[]
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
[]
> @@ -2148,8 +2148,9 @@ void hostif_sme_mode_setup(struct ks_wlan_private *priv)
>  				else
>  					rate_octet[i] =
>  					    priv->reg.rate_set.body[i];
> -			} else
> +			} else {
>  				break;
> +			}

Generally, any time you see a form like this,
the test should be reversed

	for/while/do {
		if (foo) {
			[bar...]
		} else {
			break;
		}
	
should be:

	for/while/do {
		if (!foo)
			break;
		[bar...]
	}

  reply	other threads:[~2017-02-17 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 21:41 [PATCH] Staging: ks7010: ks_*: Braces should be used on all arms of these statements Shiva Kerdel
2017-02-17 22:50 ` Joe Perches [this message]
2017-02-18  2:37   ` Joe Perches

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=1487371848.2198.6.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=georgiana.chelu93@gmail.com \
    --cc=goudapatilk@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=karniksayli1995@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mihaela.muraru21@gmail.com \
    --cc=p.hoefflin@posteo.de \
    --cc=sabitha.george@gmail.com \
    --cc=shiva@exdev.nl \
    --cc=wsa+renesas@sang-engineering.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