linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Colin King <colin.king@canonical.com>,
	Forest Bond <forest@alittletooquiet.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6656: clean up few indentation issues
Date: Wed, 31 Oct 2018 11:52:09 -0700	[thread overview]
Message-ID: <a54f58ee05b190ac66c9a1347027b8d006988b61.camel@perches.com> (raw)
In-Reply-To: <20181030111333.3181-1-colin.king@canonical.com>

On Tue, 2018-10-30 at 11:13 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Trivial fix to clean up indentation issues
[]
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index ccafcc2c87ac..b613a1d113bb 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -245,10 +245,10 @@ static int vnt_init_registers(struct vnt_private *priv)
>  		} else {
>  			priv->tx_antenna_mode = ANT_B;
>  
> -		if (priv->tx_rx_ant_inv)
> -			priv->rx_antenna_mode = ANT_A;
> -		else
> -			priv->rx_antenna_mode = ANT_B;
> +			if (priv->tx_rx_ant_inv)
> +				priv->rx_antenna_mode = ANT_A;
> +			else
> +				priv->rx_antenna_mode = ANT_B;
>  		}
>  	}

This one is perhap better resolved by moving
the inversion test after the block like:

---
 drivers/staging/vt6656/main_usb.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index ccafcc2c87ac..3830437e321a 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -227,29 +227,16 @@ static int vnt_init_registers(struct vnt_private *priv)
 	if (antenna == (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN)) {
 		priv->tx_antenna_mode = ANT_B;
 		priv->rx_antenna_sel = 1;
-
-		if (priv->tx_rx_ant_inv)
-			priv->rx_antenna_mode = ANT_A;
-		else
-			priv->rx_antenna_mode = ANT_B;
 	} else  {
 		priv->rx_antenna_sel = 0;
-
-		if (antenna & EEP_ANTENNA_AUX) {
+		if (antenna & EEP_ANTENNA_AUX)
 			priv->tx_antenna_mode = ANT_A;
-
-			if (priv->tx_rx_ant_inv)
-				priv->rx_antenna_mode = ANT_B;
-			else
-				priv->rx_antenna_mode = ANT_A;
-		} else {
-			priv->tx_antenna_mode = ANT_B;
-
-		if (priv->tx_rx_ant_inv)
-			priv->rx_antenna_mode = ANT_A;
 		else
-			priv->rx_antenna_mode = ANT_B;
-		}
+			priv->tx_antenna_mode = ANT_B;
+	}
+	if (priv->tx_rx_ant_inv) {
+		priv->rx_antenna_mode =
+			(priv->rx_antenna_mode == ANT_A) ? ANT_B : ANT_A;
 	}
 
 	/* Set initial antenna mode */




      reply	other threads:[~2018-10-31 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 11:13 [PATCH] staging: vt6656: clean up few indentation issues Colin King
2018-10-31 18:52 ` Joe Perches [this message]

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=a54f58ee05b190ac66c9a1347027b8d006988b61.camel@perches.com \
    --to=joe@perches.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).