Linux wireless drivers development
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 8/8] staging: vt6656: rf.c: replace where priv->byCurPwr == power.
Date: Mon, 03 Jun 2013 22:56:31 +0100	[thread overview]
Message-ID: <1370296591.9091.36.camel@canaries64> (raw)

priv->byCurPwr always equals power in vnt_rf_set_txpower
at switch (priv->byRFType)

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/rf.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 2152b44..2e8a964 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -798,11 +798,11 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 
 	switch (priv->byRFType) {
 	case RF_AL2230:
-		if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
+		if (power >= AL2230_PWR_IDX_LEN)
 			return false;
 
 		ret &= vnt_rf_write_embedded(priv,
-			al2230_power_table[priv->byCurPwr]);
+			al2230_power_table[power]);
 
 		if (rate <= RATE_11M)
 			ret &= vnt_rf_write_embedded(priv, 0x0001b400 +
@@ -812,11 +812,11 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 				(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
 		break;
 	case RF_AL2230S:
-		if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
+		if (power >= AL2230_PWR_IDX_LEN)
 			return false;
 
 		ret &= vnt_rf_write_embedded(priv,
-			al2230_power_table[priv->byCurPwr]);
+			al2230_power_table[power]);
 
 		if (rate <= RATE_11M) {
 			ret &= vnt_rf_write_embedded(priv, 0x040c1400 +
@@ -839,14 +839,14 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 			ret &= vnt_rf_write_embedded(priv, 0x221bb900 +
 				(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
 
-		if (priv->byCurPwr > AL7230_PWR_IDX_LEN)
+		if (power > AL7230_PWR_IDX_LEN)
 			return false;
 
 		/*
 		* 0x080F1B00 for 3 wire control TxGain(D10)
 		* and 0x31 as TX Gain value
 		*/
-		power_setting = 0x080c0b00 | ((priv->byCurPwr) << 12) |
+		power_setting = 0x080c0b00 | ((power) << 12) |
 				(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;
 
 		ret &= vnt_rf_write_embedded(priv, power_setting);
@@ -854,20 +854,20 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 		break;
 
 	case RF_VT3226:
-		if (priv->byCurPwr >= VT3226_PWR_IDX_LEN)
+		if (power >= VT3226_PWR_IDX_LEN)
 			return false;
-		power_setting = ((0x3f - priv->byCurPwr) << 20) | (0x17 << 8) |
+		power_setting = ((0x3f - power) << 20) | (0x17 << 8) |
 				(BY_VT3226_REG_LEN << 3) | IFREGCTL_REGW;
 
 		ret &= vnt_rf_write_embedded(priv, power_setting);
 
 		break;
 	case RF_VT3226D0:
-		if (priv->byCurPwr >= VT3226_PWR_IDX_LEN)
+		if (power >= VT3226_PWR_IDX_LEN)
 			return false;
 
 		if (rate <= RATE_11M) {
-			power_setting = ((0x3f-priv->byCurPwr) << 20) |
+			power_setting = ((0x3f-power) << 20) |
 				(0xe07 << 8) | (BY_VT3226_REG_LEN << 3) |
 						IFREGCTL_REGW;
 
@@ -897,7 +897,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
 					"@@@@ vnt_rf_set_txpower> 11G mode\n");
 
-			power_setting = ((0x3f-priv->byCurPwr) << 20) |
+			power_setting = ((0x3f-power) << 20) |
 				(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
 					IFREGCTL_REGW;
 
@@ -912,10 +912,10 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
 		break;
 
 	case RF_VT3342A0:
-		if (priv->byCurPwr >= VT3342_PWR_IDX_LEN)
+		if (power >= VT3342_PWR_IDX_LEN)
 			return false;
 
-		power_setting =  ((0x3F-priv->byCurPwr) << 20) |
+		power_setting =  ((0x3F-power) << 20) |
 			(0x27 << 8) | (BY_VT3342_REG_LEN << 3) |
 					IFREGCTL_REGW;
 
-- 
1.8.1.2


                 reply	other threads:[~2013-06-03 21:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1370296591.9091.36.camel@canaries64 \
    --to=tvboxspy@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@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