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 <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>
This commit is contained in:
Philipp Hortmann 2022-09-11 12:46:04 +02:00 committed by Greg Kroah-Hartman
parent 4ecaa734c5
commit 0c59cbbb59
2 changed files with 7 additions and 11 deletions

View 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;
}

View 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);