staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 11 Sep 2022 10:46:04 +0000 (12:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Sep 2022 11:58:44 +0000 (13:58 +0200)
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>
Link: https://lore.kernel.org/r/540a684266610f7618b3ef6000d4699d065c8e6f.1662890990.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/mac.c
drivers/staging/vt6655/mac.h

index b1aa5fbe4430c0c524fed1d7f70108c3c3c6eaf2..f292a34c23dd2e643355c764885061cea9e5b266 100644 (file)
@@ -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;
        }
 
index 25247b0bf0392072851da11af3a9014a4b557b09..5dd8644749ec7a78568d7e3d1498781bc7102df3 100644 (file)
@@ -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);