Skip to contentSkip to conversation

staging: vt6655: Remove functions that are never

PATCH Superseded Briana Oursler 3 participants 9 messages Mar 31, 2020 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: vt6655: Remove functions that are never

This patchset removes functions that are not called in the driver but are prototyped in card.h. Each commit limits its scope to one function definition and related documentation in code. References in the developer's initial changelog were left in place.

Functions were checked for calls using the Elixir Cross Referencer and git grep.

Per Stefano Brivio's recommendation, output of bloatometer script after changes:

add/remove: 0/3 grow/shrink: 0/0 up/down: 0/-532 (-532)
Function old new delta

CARDbSoftwareReset                            10       -     -10
CARDvSetLoopbackMode                          14       -     -14
CARDbRadioPowerOn                            508       -    -508

Total: Before=36131, After=35599, chg -1.47%

Briana Oursler (3):
Staging: vt6655: Remove CARDbSoftwareReset definition.
Staging: vt6655: Remove CARDvSetLoopbackMode definition.
Staging: vt6655: Remove CARDbRadioPowerOn definition.

 drivers/staging/vt6655/card.c | 105 ----------------------------------
 drivers/staging/vt6655/card.h |   4 --
 2 files changed, 109 deletions(-)
Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 1/3 Staging: vt6655: Remove CARDbSoftwareReset definition.

Remove function CARDbSoftwareReset that is never called, along with comments related to it.

---

Changes in v2:
- Update patch description to be more clear, changes suggested by Julia Lawall and issue found by Stefano Brivio.
- Remove extra newline that was introduced after function call, change recommended by Stefano Brivio.

 drivers/staging/vt6655/card.c | 21 ---------------------
 drivers/staging/vt6655/card.h |  1 -
 2 files changed, 22 deletions(-)
drivers/staging/vt6655/card.c +0 -21
index e65c9825ea5a..52af85fe538d 100644
@@ -12,7 +12,6 @@
  *      CARDbAddBasicRate - Add to BasicRateSet
  *      CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet
  *      CARDvSetLoopbackMode - Set Loopback mode
- *      CARDbSoftwareReset - Sortware reset NIC
  *      CARDqGetTSFOffset - Calculate TSFOffset
  *      CARDbGetCurrentTSF - Read Current NIC TSF counter
  *      CARDqGetNextTBTT - Calculate Next Beacon TSF counter
@@ -843,26 +842,6 @@ void CARDvSetLoopbackMode(struct vnt_private *priv,
 	/* set Baseband loopback */
 }
 
-/*
- * Description: Software Reset NIC
- *
- * Parameters:
- *  In:
- *      priv         - The adapter to be reset
- *  Out:
- *      none
- *
- * Return Value: none
- */
-bool CARDbSoftwareReset(struct vnt_private *priv)
-{
-	/* reset MAC */
-	if (!MACbSafeSoftwareReset(priv))
-		return false;
-
-	return true;
-}
-
 /*
  * Description: Calculate TSF offset of two TSF input
  *              Get TSF Offset from RxBCN's TSF and local TSF
drivers/staging/vt6655/card.h +0 -1
index 337266add6b2..a811ac8942a0 100644
@@ -46,7 +46,6 @@ void CARDvUpdateBasicTopRate(struct vnt_private *priv);
 bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
 void CARDvSetLoopbackMode(struct vnt_private *priv,
 			  unsigned short wLoopbackMode);
-bool CARDbSoftwareReset(struct vnt_private *priv);
 void CARDvSetFirstNextTBTT(struct vnt_private *priv,
 			   unsigned short wBeaconInterval);
 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
Signature · 1 line
2.24.1
#2 lore raw

PATCH v2 2/3 Staging: vt6655: Remove CARDvSetLoopbackMode definition.

In reply to Briana Oursler

Remove function CARDvSetLoopbackMode that is never called, along with comments related to it.

---

Changes in v2:
- Update commit description as recommended by Julia Lawall, issue found by Stefano Brivio.

 drivers/staging/vt6655/card.c | 29 -----------------------------
 drivers/staging/vt6655/card.h |  2 --
 2 files changed, 31 deletions(-)
drivers/staging/vt6655/card.c +0 -29
index 52af85fe538d..222b6ef61d9c 100644
@@ -11,7 +11,6 @@
  *      CARDvUpdateBasicTopRate - Update BasicTopRate
  *      CARDbAddBasicRate - Add to BasicRateSet
  *      CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet
- *      CARDvSetLoopbackMode - Set Loopback mode
  *      CARDqGetTSFOffset - Calculate TSFOffset
  *      CARDbGetCurrentTSF - Read Current NIC TSF counter
  *      CARDqGetNextTBTT - Calculate Next Beacon TSF counter
@@ -814,34 +813,6 @@ unsigned char CARDbyGetPktType(struct vnt_private *priv)
 		return PK_TYPE_11GB;
 }
 
-/*
- * Description: Set NIC Loopback mode
- *
- * Parameters:
- *  In:
- *      priv         - The adapter to be set
- *      wLoopbackMode   - Loopback mode to be set
- *  Out:
- *      none
- *
- * Return Value: none
- */
-void CARDvSetLoopbackMode(struct vnt_private *priv,
-			  unsigned short wLoopbackMode)
-{
-	switch (wLoopbackMode) {
-	case CARD_LB_NONE:
-	case CARD_LB_MAC:
-	case CARD_LB_PHY:
-		break;
-	default:
-		break;
-	}
-	/* set MAC loopback */
-	MACvSetLoopbackMode(priv, LOBYTE(wLoopbackMode));
-	/* set Baseband loopback */
-}
-
 /*
  * Description: Calculate TSF offset of two TSF input
  *              Get TSF Offset from RxBCN's TSF and local TSF
drivers/staging/vt6655/card.h +0 -2
index a811ac8942a0..32405027e269 100644
@@ -44,8 +44,6 @@ struct vnt_private;
 void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type);
 void CARDvUpdateBasicTopRate(struct vnt_private *priv);
 bool CARDbIsOFDMinBasicRate(struct vnt_private *priv);
-void CARDvSetLoopbackMode(struct vnt_private *priv,
-			  unsigned short wLoopbackMode);
 void CARDvSetFirstNextTBTT(struct vnt_private *priv,
 			   unsigned short wBeaconInterval);
 void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
Signature · 1 line
2.24.1
#3 lore raw

PATCH v2 3/3 Staging: vt6655: Remove CARDbRadioPowerOn definition.

In reply to Briana Oursler

Remove function CARDbRadioPowerOn that is never called, along with comments related to it.

---

Changes in v2:
- Update commit description to be more clear, as recommended by Stefano Brivio and Julia Lawall.

 drivers/staging/vt6655/card.c | 55 -----------------------------------
 drivers/staging/vt6655/card.h |  1 -
 2 files changed, 56 deletions(-)
drivers/staging/vt6655/card.c +0 -55
index 222b6ef61d9c..67b23ab0b0d1 100644
@@ -17,7 +17,6 @@
  *      CARDvSetFirstNextTBTT - Set NIC Beacon time
  *      CARDvUpdateNextTBTT - Sync. NIC Beacon time
  *      CARDbRadioPowerOff - Turn Off NIC Radio Power
- *      CARDbRadioPowerOn - Turn On NIC Radio Power
  *
  * Revision History:
  *      06-10-2003 Bryan YC Fan:  Re-write codes to support VT3253 spec.
@@ -437,60 +436,6 @@ void CARDbRadioPowerOff(struct vnt_private *priv)
 		      LED_ACTSET);  /* LED issue */
 }
 
-/*
- * Description: Turn on Radio power
- *
- * Parameters:
- *  In:
- *      priv         - The adapter to be turned on
- *  Out:
- *      none
- *
- * Return Value: true if success; otherwise false
- */
-bool CARDbRadioPowerOn(struct vnt_private *priv)
-{
-	bool bResult = true;
-
-	pr_debug("chester power on\n");
-	if (priv->bRadioControlOff) {
-		if (priv->bHWRadioOff)
-			pr_debug("chester bHWRadioOff\n");
-		if (priv->bRadioControlOff)
-			pr_debug("chester bRadioControlOff\n");
-		return false; }
-
-	if (!priv->bRadioOff) {
-		pr_debug("chester pbRadioOff\n");
-		return true; }
-
-	BBvExitDeepSleep(priv, priv->byLocalID);
-
-	MACvRegBitsOn(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON);
-
-	switch (priv->byRFType) {
-	case RF_RFMD2959:
-		MACvWordRegBitsOn(priv->PortOffset, MAC_REG_SOFTPWRCTL,
-				  SOFTPWRCTL_TXPEINV);
-		MACvWordRegBitsOff(priv->PortOffset, MAC_REG_SOFTPWRCTL,
-				   SOFTPWRCTL_SWPE1);
-		break;
-
-	case RF_AIROHA:
-	case RF_AL2230S:
-	case RF_AIROHA7230:
-		MACvWordRegBitsOn(priv->PortOffset, MAC_REG_SOFTPWRCTL,
-				  (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3));
-		break;
-	}
-
-	priv->bRadioOff = false;
-	pr_debug("chester power on\n");
-	MACvRegBitsOff(priv->PortOffset, MAC_REG_GPIOCTL0,
-		       LED_ACTSET); /* LED issue */
-	return bResult;
-}
-
 void CARDvSafeResetTx(struct vnt_private *priv)
 {
 	unsigned int uu;
drivers/staging/vt6655/card.h +0 -1
index 32405027e269..568a2ddd6588 100644
@@ -55,7 +55,6 @@ unsigned char CARDbyGetPktType(struct vnt_private *priv);
 void CARDvSafeResetTx(struct vnt_private *priv);
 void CARDvSafeResetRx(struct vnt_private *priv);
 void CARDbRadioPowerOff(struct vnt_private *priv);
-bool CARDbRadioPowerOn(struct vnt_private *priv);
 bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type);
 bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
 		    u64 qwBSSTimestamp);
Signature · 1 line
2.24.1
#4 lore raw
In reply to Briana Oursler
Quoted 1 line

Subject: [Outreachy kernel] [Patch v2 0/3] staging: vt6655: Remove functions that are never

never...? :)

Quoted 4 lines · On Mon, 30 Mar 2020 22:16:37 -0700 Briana Oursler <[email protected]>…

This patchset removes functions that are not called in the driver but are prototyped in card.h. Each commit limits its scope to one function definition and related documentation in code. References in the developer's initial changelog were left in place.

What do you mean by this? Which references?

Signature · 1 line
Stefano
#5 lore raw
Quoted 5 lines · Stefano Brivio
Quoted 2 lines

Subject: [Outreachy kernel] [Patch v2 0/3] staging: vt6655: Remove functions that are never

never...? :)

It looks like my subject got cut off. Is it okay to just call it 'dead code' in the subject of my revision? As in: staging: vt6655: Remove dead code, leaving all the rest as is (outside of changes from other feedback I may receive).

Quoted 12 lines
Quoted 6 lines · On Mon, 30 Mar 2020 22:16:37 -0700 Briana Oursler <[email protected]>…

This patchset removes functions that are not called in the driver but
are prototyped in card.h. Each commit limits its scope to one function
definition and related documentation in code. References in the developer's initial changelog were left in place.

What do you mean by this? Which references?

Apologies, that is a mistake. Their changelog does reference a deleted function elsewhere in the driver, but not in this file nor in the scope of this patch series. I confused myself there, sorry for that. I'll remove that reference from the cover letter.

Thanks,

Briana

#6 lore raw
Quoted 10 lines · Briana Oursler
Quoted 5 lines · Stefano Brivio
Quoted 2 lines

Subject: [Outreachy kernel] [Patch v2 0/3] staging: vt6655: Remove functions that are never

never...? :)

It looks like my subject got cut off. Is it okay to just call it 'dead code' in the subject of my revision? As in: staging: vt6655: Remove dead code, leaving all the rest as is (outside of changes from other feedback I may receive).

To me, dead code is a branch that is never executed. I think that saying that the function is never called in the kernel would be clearer.

julia

Quoted 27 lines
Quoted 4 lines

On Mon, 30 Mar 2020 22:16:37 -0700
Briana Oursler <[email protected]> wrote:

Quoted 9 lines
Quoted 6 lines

This patchset removes functions that are not called in the driver but
are prototyped in card.h. Each commit limits its scope to one function
definition and related documentation in code. References in the developer's initial changelog were left in place.

What do you mean by this? Which references?

Apologies, that is a mistake. Their changelog does reference a deleted function elsewhere in the driver, but not in this file nor in the scope of this patch series. I confused myself there, sorry for that. I'll remove that reference from the cover letter.

Thanks,

Briana

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/e78323c6c6a7429ad084149b66a4cd025b9dbb15.camel%40gmail.com.

#7 lore raw
Quoted 17 lines · Julia Lawall
Quoted 5 lines · Briana Oursler
Quoted 4 lines · Stefano Brivio
Quoted 3 lines

Subject: [Outreachy kernel] [Patch v2 0/3] staging: vt6655:
Remove
functions that are never

Quoted 8 lines
Quoted 2 lines

never...? :)

It looks like my subject got cut off. Is it okay to just call it 'dead
code' in the subject of my revision? As in: staging: vt6655: Remove dead code, leaving all the rest as is (outside of changes from other
feedback I may receive).

Quoted 5 lines

To me, dead code is a branch that is never executed. I think that saying
that the function is never called in the kernel would be clearer.

julia

Okay, in that case I will leave the title as it was originally intended. I'll send it as soon as I can determine how to stop the title from cutting off.

Thanks,

Briana

Quoted 33 lines
Quoted 33 lines
Quoted 11 lines
Quoted 7 lines · On Mon, 30 Mar 2020 22:16:37 -0700 Briana Oursler <[email protected]>…

This patchset removes functions that are not called in the driver
but
are prototyped in card.h. Each commit limits its scope to one function
definition and related documentation in code. References in the developer's initial changelog were left in place.

Quoted 2 lines

What do you mean by this? Which references?

Apologies, that is a mistake. Their changelog does reference a deleted
function elsewhere in the driver, but not in this file nor in the scope
of this patch series. I confused myself there, sorry for that. I'll remove that reference from the cover letter.

Thanks,

Briana

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/e78323c6c6a7429ad084149b66a4cd025b9dbb15.camel%40gmail.com
.

#8 lore raw
Quoted 22 lines · Briana Oursler
Quoted 21 lines · Julia Lawall
Quoted 5 lines · Briana Oursler
Quoted 4 lines · Stefano Brivio
Quoted 3 lines

Subject: [Outreachy kernel] [Patch v2 0/3] staging: vt6655:
Remove
functions that are never

Quoted 8 lines
Quoted 2 lines

never...? :)

It looks like my subject got cut off. Is it okay to just call it 'dead
code' in the subject of my revision? As in: staging: vt6655: Remove dead code, leaving all the rest as is (outside of changes from other
feedback I may receive).

To me, dead code is a branch that is never executed. I think that saying
that the function is never called in the kernel would be clearer.

Quoted 5 lines
Quoted 1 line

julia

Okay, in that case I will leave the title as it was originally intended. I'll send it as soon as I can determine how to stop the title from cutting off.

Maybe remove dead functions would be ok.

julia

Quoted 40 lines

Thanks,

Briana

Quoted 33 lines
Quoted 33 lines
Quoted 11 lines
Quoted 7 lines · On Mon, 30 Mar 2020 22:16:37 -0700 Briana Oursler <[email protected]>…

This patchset removes functions that are not called in the driver
but
are prototyped in card.h. Each commit limits its scope to one function
definition and related documentation in code. References in the developer's initial changelog were left in place.

Quoted 2 lines

What do you mean by this? Which references?

Apologies, that is a mistake. Their changelog does reference a deleted
function elsewhere in the driver, but not in this file nor in the scope
of this patch series. I confused myself there, sorry for that. I'll remove that reference from the cover letter.

Thanks,

Briana

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/e78323c6c6a7429ad084149b66a4cd025b9dbb15.camel%40gmail.com
.