lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a54f58ee05b190ac66c9a1347027b8d006988b61.camel@perches.com>
Date:   Wed, 31 Oct 2018 11:52:09 -0700
From:   Joe Perches <joe@...ches.com>
To:     Colin King <colin.king@...onical.com>,
        Forest Bond <forest@...ttletooquiet.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: clean up few indentation issues

On Tue, 2018-10-30 at 11:13 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.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 */



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ