From 0c59cbbb598418c3cff41432a70450b58b1c7794 Mon Sep 17 00:00:00 2001 From: Philipp Hortmann Date: Sun, 11 Sep 2022 12:46:04 +0200 Subject: [PATCH] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset 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 Link: https://lore.kernel.org/r/540a684266610f7618b3ef6000d4699d065c8e6f.1662890990.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- 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);