[PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset

Philipp Hortmann
2022-09-11T10:46:28Z

Rename function MACbSafeSoftwareReset to vt6655_mac_save_soft_reset and
abyTmpRegData to tmp_reg_data to avoid CamelCase which is not accepted by
checkpatch.pl. Remove return value bRetVal as it is unused by the calling
functions. Remove unnecessary declaration of function and make function
static. Change declaration of tmp_reg_data to shorten code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 17 +++++++----------
drivers/staging/vt6655/mac.h | 1 -
2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index b1aa5fbe4430..f292a34c23dd 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -293,23 +293,20 @@ bool MACbSoftwareReset(struct vnt_private *priv)
* Return Value: true if success; otherwise false
*
*/
-bool MACbSafeSoftwareReset(struct vnt_private *priv)
+static void vt6655_mac_save_soft_reset(struct vnt_private *priv)
{
- unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0 + MAC_MAX_CONTEXT_SIZE_PAGE1];
- bool bRetVal;
+ u8 tmp_reg_data[MAC_MAX_CONTEXT_SIZE_PAGE0 + MAC_MAX_CONTEXT_SIZE_PAGE1];

/* PATCH....
* save some important register's value, then do
* reset, then restore register's value
*/
/* save MAC context */
- vt6655_mac_save_context(priv, abyTmpRegData);
+ vt6655_mac_save_context(priv, tmp_reg_data);
/* do reset */
- bRetVal = MACbSoftwareReset(priv);
+ MACbSoftwareReset(priv);
/* restore MAC context, except CR0 */
- vt6655_mac_restore_context(priv, abyTmpRegData);
-
- return bRetVal;
+ vt6655_mac_restore_context(priv, tmp_reg_data);
}

/*
@@ -443,12 +440,12 @@ bool MACbSafeStop(struct vnt_private *priv)

if (!MACbSafeRxOff(priv)) {
pr_debug(" MACbSafeRxOff == false)\n");
- MACbSafeSoftwareReset(priv);
+ vt6655_mac_save_soft_reset(priv);
return false;
}
if (!MACbSafeTxOff(priv)) {
pr_debug(" MACbSafeTxOff == false)\n");
- MACbSafeSoftwareReset(priv);
+ vt6655_mac_save_soft_reset(priv);
return false;
}

diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 25247b0bf039..5dd8644749ec 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -554,7 +554,6 @@ void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char re
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit);

bool MACbSoftwareReset(struct vnt_private *priv);
-bool MACbSafeSoftwareReset(struct vnt_private *priv);
bool MACbSafeRxOff(struct vnt_private *priv);
bool MACbSafeTxOff(struct vnt_private *priv);
bool MACbSafeStop(struct vnt_private *priv);
--
2.37.3