* [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h
@ 2022-09-11 10:45 Philipp Hortmann
2022-09-11 10:45 ` [PATCH 01/12] staging: vt6655: Cleanup and rename function MACvSetLoopbackMode Philipp Hortmann
` (11 more replies)
0 siblings, 12 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:45 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename functions and local variables to avoid CamelCase which is not
accepted by checkpatch.pl. Remove unnecessary declaration of functions
and make functions static when possible. Change declaration of local
variables to shorten code and remove unnecessary line breaks.
Tested with vt6655 on mini PCI Module
Transferred this patch over wlan connection of vt6655
Philipp Hortmann (12):
staging: vt6655: Cleanup and rename function MACvSetLoopbackMode
staging: vt6655: Cleanup and rename function MACvSaveContext
staging: vt6655: Cleanup and rename function MACvRestoreContext
staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
staging: vt6655: Rename function MACbSafeRxOff
staging: vt6655: Rename function MACbSafeTxOff
staging: vt6655: Rename function MACbSafeStop
staging: vt6655: Rename function MACvSetCurrRx0DescAddr
staging: vt6655: Rename function MACvSetCurrRx1DescAddr
staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr
staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx
staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx
drivers/staging/vt6655/card.c | 8 ++--
drivers/staging/vt6655/mac.c | 85 ++++++++++++++++-------------------
drivers/staging/vt6655/mac.h | 22 ++-------
3 files changed, 46 insertions(+), 69 deletions(-)
--
2.37.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 01/12] staging: vt6655: Cleanup and rename function MACvSetLoopbackMode
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
@ 2022-09-11 10:45 ` Philipp Hortmann
2022-09-11 10:45 ` [PATCH 02/12] staging: vt6655: Cleanup and rename function MACvSaveContext Philipp Hortmann
` (10 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:45 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetLoopbackMode to vt6655_mac_set_loopback_mode and
byLoopbackMode to loopback_mode to avoid CamelCase which is not accepted
by checkpatch.pl. Remove unnecessary declaration of function and made
function static. Change declaration of loopback_mode to shorten code and
remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 17 ++++++++---------
drivers/staging/vt6655/mac.h | 2 --
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index d056df1220d3..567bc38ecfa9 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -13,7 +13,7 @@
* vt6655_mac_is_reg_bits_off - Test if All test Bits Off
* vt6655_mac_set_short_retry_limit - Set 802.11 Short Retry limit
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
- * MACvSetLoopbackMode - Set MAC Loopback Mode
+ * vt6655_mac_set_loopback_mode - Set MAC Loopback Mode
* MACvSaveContext - Save Context of MAC Registers
* MACvRestoreContext - Restore Context of MAC Registers
* MACbSoftwareReset - Software Reset MAC
@@ -152,21 +152,20 @@ void MACvSetLongRetryLimit(struct vnt_private *priv,
* Parameters:
* In:
* io_base - Base Address for MAC
- * byLoopbackMode - Loopback Mode
+ * loopback_mode - Loopback Mode
* Out:
* none
*
* Return Value: none
*
*/
-void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
+static void vt6655_mac_set_loopback_mode(struct vnt_private *priv, u8 loopback_mode)
{
void __iomem *io_base = priv->port_offset;
- byLoopbackMode <<= 6;
+ loopback_mode <<= 6;
/* set TCR */
- iowrite8((ioread8(io_base + MAC_REG_TEST) & 0x3f) | byLoopbackMode,
- io_base + MAC_REG_TEST);
+ iowrite8((ioread8(io_base + MAC_REG_TEST) & 0x3f) | loopback_mode, io_base + MAC_REG_TEST);
}
/*
@@ -476,13 +475,13 @@ bool MACbShutdown(struct vnt_private *priv)
void __iomem *io_base = priv->port_offset;
/* disable MAC IMR */
iowrite32(0, io_base + MAC_REG_IMR);
- MACvSetLoopbackMode(priv, MAC_LB_INTERNAL);
+ vt6655_mac_set_loopback_mode(priv, MAC_LB_INTERNAL);
/* stop the adapter */
if (!MACbSafeStop(priv)) {
- MACvSetLoopbackMode(priv, MAC_LB_NONE);
+ vt6655_mac_set_loopback_mode(priv, MAC_LB_NONE);
return false;
}
- MACvSetLoopbackMode(priv, MAC_LB_NONE);
+ vt6655_mac_set_loopback_mode(priv, MAC_LB_NONE);
return true;
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index a70e75ff78cd..f7d00a251677 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -553,8 +553,6 @@ void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char re
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit);
-void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode);
-
void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf);
void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf);
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 02/12] staging: vt6655: Cleanup and rename function MACvSaveContext
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
2022-09-11 10:45 ` [PATCH 01/12] staging: vt6655: Cleanup and rename function MACvSetLoopbackMode Philipp Hortmann
@ 2022-09-11 10:45 ` Philipp Hortmann
2022-09-11 10:45 ` [PATCH 03/12] staging: vt6655: Cleanup and rename function MACvRestoreContext Philipp Hortmann
` (9 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:45 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSaveContext to vt6655_mac_save_context to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static. Change declaration of
cxt_buf to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 6 +++---
drivers/staging/vt6655/mac.h | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 567bc38ecfa9..092b1fffcfa1 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -14,7 +14,7 @@
* vt6655_mac_set_short_retry_limit - Set 802.11 Short Retry limit
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
* vt6655_mac_set_loopback_mode - Set MAC Loopback Mode
- * MACvSaveContext - Save Context of MAC Registers
+ * vt6655_mac_save_context - Save Context of MAC Registers
* MACvRestoreContext - Restore Context of MAC Registers
* MACbSoftwareReset - Software Reset MAC
* MACbSafeRxOff - Turn Off MAC Rx
@@ -181,7 +181,7 @@ static void vt6655_mac_set_loopback_mode(struct vnt_private *priv, u8 loopback_m
* Return Value: none
*
*/
-void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf)
+static void vt6655_mac_save_context(struct vnt_private *priv, u8 *cxt_buf)
{
void __iomem *io_base = priv->port_offset;
@@ -303,7 +303,7 @@ bool MACbSafeSoftwareReset(struct vnt_private *priv)
* reset, then restore register's value
*/
/* save MAC context */
- MACvSaveContext(priv, abyTmpRegData);
+ vt6655_mac_save_context(priv, abyTmpRegData);
/* do reset */
bRetVal = MACbSoftwareReset(priv);
/* restore MAC context, except CR0 */
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index f7d00a251677..1752905d7df0 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -553,7 +553,6 @@ void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char re
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit);
-void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf);
void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf);
bool MACbSoftwareReset(struct vnt_private *priv);
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 03/12] staging: vt6655: Cleanup and rename function MACvRestoreContext
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
2022-09-11 10:45 ` [PATCH 01/12] staging: vt6655: Cleanup and rename function MACvSetLoopbackMode Philipp Hortmann
2022-09-11 10:45 ` [PATCH 02/12] staging: vt6655: Cleanup and rename function MACvSaveContext Philipp Hortmann
@ 2022-09-11 10:45 ` Philipp Hortmann
2022-09-11 10:46 ` [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Philipp Hortmann
` (8 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:45 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvRestoreContext to vt6655_mac_restore_context to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static. Change declaration of
cxt_buf to shorten code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 6 +++---
drivers/staging/vt6655/mac.h | 2 --
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 092b1fffcfa1..b1aa5fbe4430 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -15,7 +15,7 @@
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
* vt6655_mac_set_loopback_mode - Set MAC Loopback Mode
* vt6655_mac_save_context - Save Context of MAC Registers
- * MACvRestoreContext - Restore Context of MAC Registers
+ * vt6655_mac_restore_context - Restore Context of MAC Registers
* MACbSoftwareReset - Software Reset MAC
* MACbSafeRxOff - Turn Off MAC Rx
* MACbSafeTxOff - Turn Off MAC Tx
@@ -211,7 +211,7 @@ static void vt6655_mac_save_context(struct vnt_private *priv, u8 *cxt_buf)
* Return Value: none
*
*/
-void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
+static void vt6655_mac_restore_context(struct vnt_private *priv, u8 *cxt_buf)
{
void __iomem *io_base = priv->port_offset;
@@ -307,7 +307,7 @@ bool MACbSafeSoftwareReset(struct vnt_private *priv)
/* do reset */
bRetVal = MACbSoftwareReset(priv);
/* restore MAC context, except CR0 */
- MACvRestoreContext(priv, abyTmpRegData);
+ vt6655_mac_restore_context(priv, abyTmpRegData);
return bRetVal;
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 1752905d7df0..25247b0bf039 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -553,8 +553,6 @@ void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char re
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit);
-void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf);
-
bool MACbSoftwareReset(struct vnt_private *priv);
bool MACbSafeSoftwareReset(struct vnt_private *priv);
bool MACbSafeRxOff(struct vnt_private *priv);
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (2 preceding siblings ...)
2022-09-11 10:45 ` [PATCH 03/12] staging: vt6655: Cleanup and rename function MACvRestoreContext Philipp Hortmann
@ 2022-09-11 10:46 ` Philipp Hortmann
2022-09-13 10:12 ` Dan Carpenter
2022-09-11 10:46 ` [PATCH 05/12] staging: vt6655: Rename function MACbSafeRxOff Philipp Hortmann
` (7 subsequent siblings)
11 siblings, 1 reply; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:46 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 05/12] staging: vt6655: Rename function MACbSafeRxOff
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (3 preceding siblings ...)
2022-09-11 10:46 ` [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Philipp Hortmann
@ 2022-09-11 10:46 ` Philipp Hortmann
2022-09-11 10:46 ` [PATCH 06/12] staging: vt6655: Rename function MACbSafeTxOff Philipp Hortmann
` (6 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:46 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACbSafeRxOff to vt6655_mac_safe_rx_off to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 8 ++++----
drivers/staging/vt6655/mac.h | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index f292a34c23dd..e0216d320235 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -17,7 +17,7 @@
* vt6655_mac_save_context - Save Context of MAC Registers
* vt6655_mac_restore_context - Restore Context of MAC Registers
* MACbSoftwareReset - Software Reset MAC
- * MACbSafeRxOff - Turn Off MAC Rx
+ * vt6655_mac_safe_rx_off - Turn Off MAC Rx
* MACbSafeTxOff - Turn Off MAC Tx
* MACbSafeStop - Stop MAC function
* MACbShutdown - Shut down MAC
@@ -322,7 +322,7 @@ static void vt6655_mac_save_soft_reset(struct vnt_private *priv)
* Return Value: true if success; otherwise false
*
*/
-bool MACbSafeRxOff(struct vnt_private *priv)
+static bool vt6655_mac_safe_rx_off(struct vnt_private *priv)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
@@ -438,8 +438,8 @@ bool MACbSafeStop(struct vnt_private *priv)
vt6655_mac_reg_bits_off(io_base, MAC_REG_TCR, TCR_AUTOBCNTX);
- if (!MACbSafeRxOff(priv)) {
- pr_debug(" MACbSafeRxOff == false)\n");
+ if (!vt6655_mac_safe_rx_off(priv)) {
+ pr_debug(" vt6655_mac_safe_rx_off == false)\n");
vt6655_mac_save_soft_reset(priv);
return false;
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 5dd8644749ec..e6ff860c1bfa 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 MACbSafeRxOff(struct vnt_private *priv);
bool MACbSafeTxOff(struct vnt_private *priv);
bool MACbSafeStop(struct vnt_private *priv);
bool MACbShutdown(struct vnt_private *priv);
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 06/12] staging: vt6655: Rename function MACbSafeTxOff
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (4 preceding siblings ...)
2022-09-11 10:46 ` [PATCH 05/12] staging: vt6655: Rename function MACbSafeRxOff Philipp Hortmann
@ 2022-09-11 10:46 ` Philipp Hortmann
2022-09-11 10:46 ` [PATCH 07/12] staging: vt6655: Rename function MACbSafeStop Philipp Hortmann
` (5 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:46 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACbSafeTxOff to vt6655_mac_safe_tx_off to avoid
CamelCase which is not accepted by checkpatch.pl. Remove unnecessary
declaration of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 8 ++++----
drivers/staging/vt6655/mac.h | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index e0216d320235..24851fe53683 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -18,7 +18,7 @@
* vt6655_mac_restore_context - Restore Context of MAC Registers
* MACbSoftwareReset - Software Reset MAC
* vt6655_mac_safe_rx_off - Turn Off MAC Rx
- * MACbSafeTxOff - Turn Off MAC Tx
+ * vt6655_mac_safe_tx_off - Turn Off MAC Tx
* MACbSafeStop - Stop MAC function
* MACbShutdown - Shut down MAC
* MACvInitialize - Initialize MAC
@@ -376,7 +376,7 @@ static bool vt6655_mac_safe_rx_off(struct vnt_private *priv)
* Return Value: true if success; otherwise false
*
*/
-bool MACbSafeTxOff(struct vnt_private *priv)
+static bool vt6655_mac_safe_tx_off(struct vnt_private *priv)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
@@ -443,8 +443,8 @@ bool MACbSafeStop(struct vnt_private *priv)
vt6655_mac_save_soft_reset(priv);
return false;
}
- if (!MACbSafeTxOff(priv)) {
- pr_debug(" MACbSafeTxOff == false)\n");
+ if (!vt6655_mac_safe_tx_off(priv)) {
+ pr_debug(" vt6655_mac_safe_tx_off == false)\n");
vt6655_mac_save_soft_reset(priv);
return false;
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index e6ff860c1bfa..12b4f8937d14 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 MACbSafeTxOff(struct vnt_private *priv);
bool MACbSafeStop(struct vnt_private *priv);
bool MACbShutdown(struct vnt_private *priv);
void MACvInitialize(struct vnt_private *priv);
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 07/12] staging: vt6655: Rename function MACbSafeStop
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (5 preceding siblings ...)
2022-09-11 10:46 ` [PATCH 06/12] staging: vt6655: Rename function MACbSafeTxOff Philipp Hortmann
@ 2022-09-11 10:46 ` Philipp Hortmann
2022-09-11 10:46 ` [PATCH 08/12] staging: vt6655: Rename function MACvSetCurrRx0DescAddr Philipp Hortmann
` (4 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:46 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACbSafeStop to vt6655_mac_safe_stop to avoid CamelCase
which is not accepted by checkpatch.pl. Remove unnecessary declaration
of function and make function static.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 6 +++---
drivers/staging/vt6655/mac.h | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 24851fe53683..e1f639787316 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -19,7 +19,7 @@
* MACbSoftwareReset - Software Reset MAC
* vt6655_mac_safe_rx_off - Turn Off MAC Rx
* vt6655_mac_safe_tx_off - Turn Off MAC Tx
- * MACbSafeStop - Stop MAC function
+ * vt6655_mac_safe_stop - Stop MAC function
* MACbShutdown - Shut down MAC
* MACvInitialize - Initialize MAC
* MACvSetCurrRxDescAddr - Set Rx Descriptors Address
@@ -432,7 +432,7 @@ static bool vt6655_mac_safe_tx_off(struct vnt_private *priv)
* Return Value: true if success; otherwise false
*
*/
-bool MACbSafeStop(struct vnt_private *priv)
+static bool vt6655_mac_safe_stop(struct vnt_private *priv)
{
void __iomem *io_base = priv->port_offset;
@@ -474,7 +474,7 @@ bool MACbShutdown(struct vnt_private *priv)
iowrite32(0, io_base + MAC_REG_IMR);
vt6655_mac_set_loopback_mode(priv, MAC_LB_INTERNAL);
/* stop the adapter */
- if (!MACbSafeStop(priv)) {
+ if (!vt6655_mac_safe_stop(priv)) {
vt6655_mac_set_loopback_mode(priv, MAC_LB_NONE);
return false;
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 12b4f8937d14..c6147a4f563e 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 MACbSafeStop(struct vnt_private *priv);
bool MACbShutdown(struct vnt_private *priv);
void MACvInitialize(struct vnt_private *priv);
void MACvSetCurrRx0DescAddr(struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 08/12] staging: vt6655: Rename function MACvSetCurrRx0DescAddr
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (6 preceding siblings ...)
2022-09-11 10:46 ` [PATCH 07/12] staging: vt6655: Rename function MACbSafeStop Philipp Hortmann
@ 2022-09-11 10:46 ` Philipp Hortmann
2022-09-11 10:47 ` [PATCH 09/12] staging: vt6655: Rename function MACvSetCurrRx1DescAddr Philipp Hortmann
` (3 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:46 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetCurrRx0DescAddr to vt6655_mac_set_curr_rx_0_desc...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/mac.c | 2 +-
drivers/staging/vt6655/mac.h | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 1b2ba6793ead..dc39b3668c77 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -458,7 +458,7 @@ void CARDvSafeResetRx(struct vnt_private *priv)
iowrite32(RX_PERPKT, priv->port_offset + MAC_REG_RXDMACTL0);
iowrite32(RX_PERPKT, priv->port_offset + MAC_REG_RXDMACTL1);
/* set MAC RD pointer */
- MACvSetCurrRx0DescAddr(priv, priv->rd0_pool_dma);
+ vt6655_mac_set_curr_rx_0_desc_addr(priv, priv->rd0_pool_dma);
MACvSetCurrRx1DescAddr(priv, priv->rd1_pool_dma);
}
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index e1f639787316..e88536705d23 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -527,7 +527,7 @@ void MACvInitialize(struct vnt_private *priv)
* Return Value: none
*
*/
-void MACvSetCurrRx0DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
+void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index c6147a4f563e..b092e59a5b98 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -556,8 +556,7 @@ void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit)
bool MACbSoftwareReset(struct vnt_private *priv);
bool MACbShutdown(struct vnt_private *priv);
void MACvInitialize(struct vnt_private *priv);
-void MACvSetCurrRx0DescAddr(struct vnt_private *priv,
- u32 curr_desc_addr);
+void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void MACvSetCurrRx1DescAddr(struct vnt_private *priv,
u32 curr_desc_addr);
void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 09/12] staging: vt6655: Rename function MACvSetCurrRx1DescAddr
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (7 preceding siblings ...)
2022-09-11 10:46 ` [PATCH 08/12] staging: vt6655: Rename function MACvSetCurrRx0DescAddr Philipp Hortmann
@ 2022-09-11 10:47 ` Philipp Hortmann
2022-09-11 10:47 ` [PATCH 10/12] staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr Philipp Hortmann
` (2 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:47 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetCurrRx1DescAddr to vt6655_mac_set_curr_rx_1_desc...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/mac.c | 2 +-
drivers/staging/vt6655/mac.h | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index dc39b3668c77..d137b4b45e3b 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -460,7 +460,7 @@ void CARDvSafeResetRx(struct vnt_private *priv)
/* set MAC RD pointer */
vt6655_mac_set_curr_rx_0_desc_addr(priv, priv->rd0_pool_dma);
- MACvSetCurrRx1DescAddr(priv, priv->rd1_pool_dma);
+ vt6655_mac_set_curr_rx_1_desc_addr(priv, priv->rd1_pool_dma);
}
/*
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index e88536705d23..d6614be79e39 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -561,7 +561,7 @@ void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_
* Return Value: none
*
*/
-void MACvSetCurrRx1DescAddr(struct vnt_private *priv, u32 curr_desc_addr)
+void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index b092e59a5b98..fff9dc72e2c0 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -557,8 +557,7 @@ bool MACbSoftwareReset(struct vnt_private *priv);
bool MACbShutdown(struct vnt_private *priv);
void MACvInitialize(struct vnt_private *priv);
void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
-void MACvSetCurrRx1DescAddr(struct vnt_private *priv,
- u32 curr_desc_addr);
+void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
u32 curr_desc_addr);
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 10/12] staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (8 preceding siblings ...)
2022-09-11 10:47 ` [PATCH 09/12] staging: vt6655: Rename function MACvSetCurrRx1DescAddr Philipp Hortmann
@ 2022-09-11 10:47 ` Philipp Hortmann
2022-09-11 10:47 ` [PATCH 11/12] staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx Philipp Hortmann
2022-09-11 10:47 ` [PATCH 12/12] staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx Philipp Hortmann
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:47 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetCurrTXDescAddr to vt6655_mac_set_curr_tx_desc_addr
and iTxType to tx_type to avoid CamelCase which is not accepted by
checkpatch.pl. Remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 4 ++--
drivers/staging/vt6655/mac.c | 7 +++----
drivers/staging/vt6655/mac.h | 3 +--
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index d137b4b45e3b..c680925b9c92 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -409,9 +409,9 @@ void CARDvSafeResetTx(struct vnt_private *priv)
}
/* set MAC TD pointer */
- MACvSetCurrTXDescAddr(TYPE_TXDMA0, priv, priv->td0_pool_dma);
+ vt6655_mac_set_curr_tx_desc_addr(TYPE_TXDMA0, priv, priv->td0_pool_dma);
- MACvSetCurrTXDescAddr(TYPE_AC0DMA, priv, priv->td1_pool_dma);
+ vt6655_mac_set_curr_tx_desc_addr(TYPE_AC0DMA, priv, priv->td1_pool_dma);
/* set MAC Beacon TX pointer */
iowrite32((u32)priv->tx_beacon_dma, priv->port_offset + MAC_REG_BCNDMAPTR);
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index d6614be79e39..0ff98468b2e0 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -653,12 +653,11 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
iowrite8(DMACTL_RUN, io_base + MAC_REG_AC0DMACTL);
}
-void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
- u32 curr_desc_addr)
+void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32 curr_desc_addr)
{
- if (iTxType == TYPE_AC0DMA)
+ if (tx_type == TYPE_AC0DMA)
MACvSetCurrAC0DescAddrEx(priv, curr_desc_addr);
- else if (iTxType == TYPE_TXDMA0)
+ else if (tx_type == TYPE_TXDMA0)
MACvSetCurrTx0DescAddrEx(priv, curr_desc_addr);
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index fff9dc72e2c0..0224f710d603 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -558,8 +558,7 @@ bool MACbShutdown(struct vnt_private *priv);
void MACvInitialize(struct vnt_private *priv);
void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
-void MACvSetCurrTXDescAddr(int iTxType, struct vnt_private *priv,
- u32 curr_desc_addr);
+void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32 curr_desc_addr);
void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
u32 curr_desc_addr);
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 11/12] staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (9 preceding siblings ...)
2022-09-11 10:47 ` [PATCH 10/12] staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr Philipp Hortmann
@ 2022-09-11 10:47 ` Philipp Hortmann
2022-09-11 10:47 ` [PATCH 12/12] staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx Philipp Hortmann
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:47 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetCurrTx0DescAddrEx to vt6655_mac_set_curr_tx_0_...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary declaration of function and make function static. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 5 ++---
drivers/staging/vt6655/mac.h | 2 --
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 0ff98468b2e0..2fbee8508f0e 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -595,8 +595,7 @@ void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_
* Return Value: none
*
*/
-void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
- u32 curr_desc_addr)
+static void vt6655_mac_set_curr_tx_0_desc_addr_ex(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
@@ -658,7 +657,7 @@ void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32
if (tx_type == TYPE_AC0DMA)
MACvSetCurrAC0DescAddrEx(priv, curr_desc_addr);
else if (tx_type == TYPE_TXDMA0)
- MACvSetCurrTx0DescAddrEx(priv, curr_desc_addr);
+ vt6655_mac_set_curr_tx_0_desc_addr_ex(priv, curr_desc_addr);
}
/*
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 0224f710d603..3fbb891ac57c 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -559,8 +559,6 @@ void MACvInitialize(struct vnt_private *priv);
void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32 curr_desc_addr);
-void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv,
- u32 curr_desc_addr);
void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
u32 curr_desc_addr);
void MACvSetCurrSyncDescAddrEx(struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 12/12] staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
` (10 preceding siblings ...)
2022-09-11 10:47 ` [PATCH 11/12] staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx Philipp Hortmann
@ 2022-09-11 10:47 ` Philipp Hortmann
11 siblings, 0 replies; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-11 10:47 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetCurrAC0DescAddrEx to vt6655_mac_set_curr_ac_0...
to avoid CamelCase which is not accepted by checkpatch.pl. Remove
unnecessary declaration of function and make function static. Remove
unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 5 ++---
drivers/staging/vt6655/mac.h | 2 --
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 2fbee8508f0e..b4ebc7d31961 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -630,8 +630,7 @@ static void vt6655_mac_set_curr_tx_0_desc_addr_ex(struct vnt_private *priv, u32
*
*/
/* TxDMA1 = AC0DMA */
-void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
- u32 curr_desc_addr)
+static void vt6655_mac_set_curr_ac_0_desc_addr_ex(struct vnt_private *priv, u32 curr_desc_addr)
{
void __iomem *io_base = priv->port_offset;
unsigned short ww;
@@ -655,7 +654,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32 curr_desc_addr)
{
if (tx_type == TYPE_AC0DMA)
- MACvSetCurrAC0DescAddrEx(priv, curr_desc_addr);
+ vt6655_mac_set_curr_ac_0_desc_addr_ex(priv, curr_desc_addr);
else if (tx_type == TYPE_TXDMA0)
vt6655_mac_set_curr_tx_0_desc_addr_ex(priv, curr_desc_addr);
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 3fbb891ac57c..acf931c3f5fd 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -559,8 +559,6 @@ void MACvInitialize(struct vnt_private *priv);
void vt6655_mac_set_curr_rx_0_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void vt6655_mac_set_curr_rx_1_desc_addr(struct vnt_private *priv, u32 curr_desc_addr);
void vt6655_mac_set_curr_tx_desc_addr(int tx_type, struct vnt_private *priv, u32 curr_desc_addr);
-void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv,
- u32 curr_desc_addr);
void MACvSetCurrSyncDescAddrEx(struct vnt_private *priv,
u32 curr_desc_addr);
void MACvSetCurrATIMDescAddrEx(struct vnt_private *priv,
--
2.37.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
2022-09-11 10:46 ` [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Philipp Hortmann
@ 2022-09-13 10:12 ` Dan Carpenter
2022-09-13 18:26 ` Philipp Hortmann
0 siblings, 1 reply; 16+ messages in thread
From: Dan Carpenter @ 2022-09-13 10:12 UTC (permalink / raw)
To: Philipp Hortmann
Cc: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
On Sun, Sep 11, 2022 at 12:46:04PM +0200, Philipp Hortmann wrote:
> 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.
Please don't mix this kind of stuff into a patch like this.
> Remove unnecessary declaration of function and make function
> static. Change declaration of tmp_reg_data to shorten code.
When I'm reviewing rename patches I have a script where I call
`rename_rev.pl -a` and it just parses the patch and outputs:
RENAMES:
abyTmpRegData => tmp_reg_data
MACbSafeSoftwareReset => vt6655_mac_save_soft_reset
I don't invest much time in thinking about the new names. The review
takes me about 5 seconds.
Then once you start marking the functions as static then that's slightly
a headache because now I have to look at that part by hand. But
whatever, you can kind of sell that as one thing.
But then when you mix ignoring the error codes in as well it's a big
headache. At first I thought it was because MACbSoftwareReset() always
returns true, so I pulled up that code and that's not true. So then I
am annoyed. And I pull up the commit message to see what's going on
and sure enough that change is burried in the middle of the paragraph.
Don't do that. Just do the renames. Then change all the functions in
one file to static at once. Then make the function void in a separate
patch.
The other thing is that making functions static is not at all
controversial. So long as it builds we will always accept those
patches.
Renaming variables is not super controversial. Sometimes people quarrel
about the new name. For example, I don't like a tmp variable which has
a long name like "tmp_reg_data". Just call it either "tmp" or
"reg_data". Not both. Don't write an essay.
But making functions void is sort of controversial... It's probably the
right thing in this context. But what I'm saying is don't mix things
which different controversial levels, because it means that someone is
going to complain. I would have ignored the "tmp_reg_data" thing
except now I'm already complaining about stuff I may as well mention it.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
2022-09-13 10:12 ` Dan Carpenter
@ 2022-09-13 18:26 ` Philipp Hortmann
2022-09-14 14:47 ` Dan Carpenter
0 siblings, 1 reply; 16+ messages in thread
From: Philipp Hortmann @ 2022-09-13 18:26 UTC (permalink / raw)
To: Dan Carpenter
Cc: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
On 9/13/22 12:12, Dan Carpenter wrote:
> On Sun, Sep 11, 2022 at 12:46:04PM +0200, Philipp Hortmann wrote:
>> 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.
> Please don't mix this kind of stuff into a patch like this.
>
In the past Greg let me know that I used to many patches for a change in
the same lines of code and that it would be easier for him to review
when less patches do the same.
As you wrote I am changing to many things at once. Sorry for breaking
your automatism.
I will consider your hints for the next patches.
Thanks
Bye Philipp
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset
2022-09-13 18:26 ` Philipp Hortmann
@ 2022-09-14 14:47 ` Dan Carpenter
0 siblings, 0 replies; 16+ messages in thread
From: Dan Carpenter @ 2022-09-14 14:47 UTC (permalink / raw)
To: Philipp Hortmann
Cc: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
On Tue, Sep 13, 2022 at 08:26:04PM +0200, Philipp Hortmann wrote:
> On 9/13/22 12:12, Dan Carpenter wrote:
> > On Sun, Sep 11, 2022 at 12:46:04PM +0200, Philipp Hortmann wrote:
> > > 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.
> > Please don't mix this kind of stuff into a patch like this.
> >
>
> In the past Greg let me know that I used to many patches for a change in the
> same lines of code and that it would be easier for him to review when less
> patches do the same.
>
It's some kind of an art to write patches that are easy to review...
regards,
dan carpenter
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2022-09-14 14:47 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-11 10:45 [PATCH 00/12] staging: vt6655: Cleanup and rename functions of mac.h Philipp Hortmann
2022-09-11 10:45 ` [PATCH 01/12] staging: vt6655: Cleanup and rename function MACvSetLoopbackMode Philipp Hortmann
2022-09-11 10:45 ` [PATCH 02/12] staging: vt6655: Cleanup and rename function MACvSaveContext Philipp Hortmann
2022-09-11 10:45 ` [PATCH 03/12] staging: vt6655: Cleanup and rename function MACvRestoreContext Philipp Hortmann
2022-09-11 10:46 ` [PATCH 04/12] staging: vt6655: Cleanup and rename function MACbSafeSoftwareReset Philipp Hortmann
2022-09-13 10:12 ` Dan Carpenter
2022-09-13 18:26 ` Philipp Hortmann
2022-09-14 14:47 ` Dan Carpenter
2022-09-11 10:46 ` [PATCH 05/12] staging: vt6655: Rename function MACbSafeRxOff Philipp Hortmann
2022-09-11 10:46 ` [PATCH 06/12] staging: vt6655: Rename function MACbSafeTxOff Philipp Hortmann
2022-09-11 10:46 ` [PATCH 07/12] staging: vt6655: Rename function MACbSafeStop Philipp Hortmann
2022-09-11 10:46 ` [PATCH 08/12] staging: vt6655: Rename function MACvSetCurrRx0DescAddr Philipp Hortmann
2022-09-11 10:47 ` [PATCH 09/12] staging: vt6655: Rename function MACvSetCurrRx1DescAddr Philipp Hortmann
2022-09-11 10:47 ` [PATCH 10/12] staging: vt6655: Cleanup and rename function MACvSetCurrTXDescAddr Philipp Hortmann
2022-09-11 10:47 ` [PATCH 11/12] staging: vt6655: Rename function MACvSetCurrTx0DescAddrEx Philipp Hortmann
2022-09-11 10:47 ` [PATCH 12/12] staging: vt6655: Rename function MACvSetCurrAC0DescAddrEx Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox