* [PATCH 1/9] staging: vt6655: Remove declaration of s_vCalculateOFDMRParameter
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
@ 2022-08-28 6:53 ` Philipp Hortmann
2022-08-28 6:53 ` [PATCH 2/9] staging: vt6655: Convert macro MACvSetBBType to function Philipp Hortmann
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:53 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Remove declaration of s_vCalculateOFDMRParameter as definition
follows just behind.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 846469cc06bb..bbe05d9538a1 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -55,10 +55,6 @@ static const unsigned short cwRXBCNTSFOff[MAX_RATE] = {
/*--------------------- Static Functions --------------------------*/
-static void s_vCalculateOFDMRParameter(unsigned char rate, u8 bb_type,
- unsigned char *pbyTxRate,
- unsigned char *pbyRsvTime);
-
/*--------------------- Export Functions --------------------------*/
/*
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/9] staging: vt6655: Convert macro MACvSetBBType to function
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
2022-08-28 6:53 ` [PATCH 1/9] staging: vt6655: Remove declaration of s_vCalculateOFDMRParameter Philipp Hortmann
@ 2022-08-28 6:53 ` Philipp Hortmann
2022-08-28 6:53 ` [PATCH 3/9] staging: vt6655: Rename function MACvSetBBType Philipp Hortmann
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:53 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Convert macro to static function. Multiline macros are not liked by
kernel community. Rename variable dwOrgValue to reg_value and byTyp to
mask to avoid CamelCase which is not accepted by checkpatch.pl. Change
variable declaration to u32 as this improves readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 10 ++++++++++
drivers/staging/vt6655/mac.h | 9 ---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index bbe05d9538a1..6711743dcf4a 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -55,6 +55,16 @@ static const unsigned short cwRXBCNTSFOff[MAX_RATE] = {
/*--------------------- Static Functions --------------------------*/
+static void MACvSetBBType(void __iomem *iobase, u32 mask)
+{
+ u32 reg_value;
+
+ reg_value = ioread32(iobase + MAC_REG_ENCFG);
+ reg_value = reg_value & ~ENCFG_BBTYPE_MASK;
+ reg_value = reg_value | mask;
+ iowrite32(reg_value, iobase + MAC_REG_ENCFG);
+}
+
/*--------------------- Export Functions --------------------------*/
/*
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index a75cd318ee25..b6c4f2bb096a 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -543,15 +543,6 @@
#define MACvSelectPage1(iobase) \
iowrite8(1, iobase + MAC_REG_PAGE1SEL)
-#define MACvSetBBType(iobase, byTyp) \
-do { \
- unsigned long dwOrgValue; \
- dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \
- dwOrgValue = dwOrgValue & ~ENCFG_BBTYPE_MASK; \
- dwOrgValue = dwOrgValue | (unsigned long)byTyp; \
- iowrite32((u32)dwOrgValue, iobase + MAC_REG_ENCFG); \
-} while (0)
-
#define MACvSetRFLE_LatchBase(iobase) \
vt6655_mac_word_reg_bits_on(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/9] staging: vt6655: Rename function MACvSetBBType
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
2022-08-28 6:53 ` [PATCH 1/9] staging: vt6655: Remove declaration of s_vCalculateOFDMRParameter Philipp Hortmann
2022-08-28 6:53 ` [PATCH 2/9] staging: vt6655: Convert macro MACvSetBBType to function Philipp Hortmann
@ 2022-08-28 6:53 ` Philipp Hortmann
2022-08-28 6:53 ` [PATCH 4/9] staging: vt6655: Rename macro MACvSelectPage0 Philipp Hortmann
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:53 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename MACvSetBBType function to vt6655_mac_set_bb_type to avoid
CamelCase which is not accepted by checkpatch.pl and to clean up
namespace.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 6711743dcf4a..c442a1e580ab 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -55,7 +55,7 @@ static const unsigned short cwRXBCNTSFOff[MAX_RATE] = {
/*--------------------- Static Functions --------------------------*/
-static void MACvSetBBType(void __iomem *iobase, u32 mask)
+static void vt6655_mac_set_bb_type(void __iomem *iobase, u32 mask)
{
u32 reg_value;
@@ -192,21 +192,21 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
/* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
if (bb_type == BB_TYPE_11A) {
- MACvSetBBType(priv->port_offset, BB_TYPE_11A);
+ vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11A);
bb_write_embedded(priv, 0x88, 0x03);
bySlot = C_SLOT_SHORT;
bySIFS = C_SIFS_A;
byDIFS = C_SIFS_A + 2 * C_SLOT_SHORT;
byCWMaxMin = 0xA4;
} else if (bb_type == BB_TYPE_11B) {
- MACvSetBBType(priv->port_offset, BB_TYPE_11B);
+ vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11B);
bb_write_embedded(priv, 0x88, 0x02);
bySlot = C_SLOT_LONG;
bySIFS = C_SIFS_BG;
byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
byCWMaxMin = 0xA5;
} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
- MACvSetBBType(priv->port_offset, BB_TYPE_11G);
+ vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11G);
bb_write_embedded(priv, 0x88, 0x08);
bySIFS = C_SIFS_BG;
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/9] staging: vt6655: Rename macro MACvSelectPage0
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (2 preceding siblings ...)
2022-08-28 6:53 ` [PATCH 3/9] staging: vt6655: Rename function MACvSetBBType Philipp Hortmann
@ 2022-08-28 6:53 ` Philipp Hortmann
2022-08-28 6:54 ` [PATCH 5/9] staging: vt6655: Rename macro MACvSelectPage1 Philipp Hortmann
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:53 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename MACvSelectPage0 macro to VT6655_MAC_SELECT_PAGE0 to avoid
CamelCase which is not accepted by checkpatch.pl and to clean up
namespace. Remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/channel.c | 2 +-
drivers/staging/vt6655/device_main.c | 6 +++---
drivers/staging/vt6655/mac.c | 4 ++--
drivers/staging/vt6655/mac.h | 3 +--
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index c442a1e580ab..a4ebe59df5b8 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -643,7 +643,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)
&byRsvTime);
iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_72);
/* Set to Page0 */
- MACvSelectPage0(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE0(priv->port_offset);
spin_unlock_irqrestore(&priv->lock, flags);
}
diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index e926f9829a15..ae6bf9493611 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -121,7 +121,7 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWRCCK);
RFbSetPower(priv, RATE_6M, priv->byCurrentCh);
iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWROFDM);
- MACvSelectPage0(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE0(priv->port_offset);
spin_unlock_irqrestore(&priv->lock, flags);
}
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 8e2a976aaaad..283119bbe2fb 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -404,7 +404,7 @@ static void device_init_registers(struct vnt_private *priv)
iowrite8(MSRCTL1_TXPWR | MSRCTL1_CSAPAREN, priv->port_offset + MAC_REG_MSRCTL + 1);
- MACvSelectPage0(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE0(priv->port_offset);
}
/* use relative tx timeout and 802.11i D4 */
@@ -1592,7 +1592,7 @@ static void vnt_configure(struct ieee80211_hw *hw,
iowrite32(0xffffffff, priv->port_offset + MAC_REG_MAR0);
iowrite32(0xffffffff, priv->port_offset + MAC_REG_MAR0 + 4);
- MACvSelectPage0(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE0(priv->port_offset);
} else {
MACvSelectPage1(priv->port_offset);
@@ -1601,7 +1601,7 @@ static void vnt_configure(struct ieee80211_hw *hw,
iowrite32((u32)(multicast >> 32),
priv->port_offset + MAC_REG_MAR0 + 4);
- MACvSelectPage0(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE0(priv->port_offset);
}
spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index dcc649532737..8485cd0a81c0 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -219,7 +219,7 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf)
memcpy_fromio(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
MAC_MAX_CONTEXT_SIZE_PAGE1);
- MACvSelectPage0(io_base);
+ VT6655_MAC_SELECT_PAGE0(io_base);
}
/*
@@ -245,7 +245,7 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
memcpy_toio(io_base, cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0,
MAC_MAX_CONTEXT_SIZE_PAGE1);
- MACvSelectPage0(io_base);
+ VT6655_MAC_SELECT_PAGE0(io_base);
/* restore RCR,TCR,IMR... */
memcpy_toio(io_base + MAC_REG_RCR, cxt_buf + MAC_REG_RCR,
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index b6c4f2bb096a..a14b38a96ec6 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -537,8 +537,7 @@
/*--------------------- Export Macros ------------------------------*/
-#define MACvSelectPage0(iobase) \
- iowrite8(0, iobase + MAC_REG_PAGE1SEL)
+#define VT6655_MAC_SELECT_PAGE0(iobase) iowrite8(0, iobase + MAC_REG_PAGE1SEL)
#define MACvSelectPage1(iobase) \
iowrite8(1, iobase + MAC_REG_PAGE1SEL)
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/9] staging: vt6655: Rename macro MACvSelectPage1
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (3 preceding siblings ...)
2022-08-28 6:53 ` [PATCH 4/9] staging: vt6655: Rename macro MACvSelectPage0 Philipp Hortmann
@ 2022-08-28 6:54 ` Philipp Hortmann
2022-08-28 6:54 ` [PATCH 6/9] staging: vt6655: Replace macro MACvSetRFLE_LatchBase Philipp Hortmann
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:54 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename MACvSelectPage1 macro to VT6655_MAC_SELECT_PAGE1 to avoid
CamelCase which is not accepted by checkpatch.pl and to clean up
namespace. Remove unnecessary line break.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/channel.c | 2 +-
drivers/staging/vt6655/device_main.c | 6 +++---
drivers/staging/vt6655/mac.c | 4 ++--
drivers/staging/vt6655/mac.h | 3 +--
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index a4ebe59df5b8..1b2ba6793ead 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -545,7 +545,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)
spin_lock_irqsave(&priv->lock, flags);
/* Set to Page1 */
- MACvSelectPage1(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE1(priv->port_offset);
/* RSPINF_b_1 */
vnt_get_phy_field(priv, 14,
diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index ae6bf9493611..4122875ebcaa 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -116,7 +116,7 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
spin_lock_irqsave(&priv->lock, flags);
/* set HW default power register */
- MACvSelectPage1(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE1(priv->port_offset);
RFbSetPower(priv, RATE_1M, priv->byCurrentCh);
iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWRCCK);
RFbSetPower(priv, RATE_6M, priv->byCurrentCh);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 283119bbe2fb..cd748b1665bb 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -400,7 +400,7 @@ static void device_init_registers(struct vnt_private *priv)
}
if (priv->local_id > REV_ID_VT3253_B1) {
- MACvSelectPage1(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE1(priv->port_offset);
iowrite8(MSRCTL1_TXPWR | MSRCTL1_CSAPAREN, priv->port_offset + MAC_REG_MSRCTL + 1);
@@ -1587,14 +1587,14 @@ static void vnt_configure(struct ieee80211_hw *hw,
spin_lock_irqsave(&priv->lock, flags);
if (priv->mc_list_count > 2) {
- MACvSelectPage1(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE1(priv->port_offset);
iowrite32(0xffffffff, priv->port_offset + MAC_REG_MAR0);
iowrite32(0xffffffff, priv->port_offset + MAC_REG_MAR0 + 4);
VT6655_MAC_SELECT_PAGE0(priv->port_offset);
} else {
- MACvSelectPage1(priv->port_offset);
+ VT6655_MAC_SELECT_PAGE1(priv->port_offset);
multicast = le64_to_cpu(multicast);
iowrite32((u32)multicast, priv->port_offset + MAC_REG_MAR0);
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 8485cd0a81c0..742391b24afb 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -213,7 +213,7 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf)
/* read page0 register */
memcpy_fromio(cxt_buf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0);
- MACvSelectPage1(io_base);
+ VT6655_MAC_SELECT_PAGE1(io_base);
/* read page1 register */
memcpy_fromio(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
@@ -240,7 +240,7 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf)
{
void __iomem *io_base = priv->port_offset;
- MACvSelectPage1(io_base);
+ VT6655_MAC_SELECT_PAGE1(io_base);
/* restore page1 */
memcpy_toio(io_base, cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0,
MAC_MAX_CONTEXT_SIZE_PAGE1);
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index a14b38a96ec6..3af8abc305b1 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -539,8 +539,7 @@
#define VT6655_MAC_SELECT_PAGE0(iobase) iowrite8(0, iobase + MAC_REG_PAGE1SEL)
-#define MACvSelectPage1(iobase) \
- iowrite8(1, iobase + MAC_REG_PAGE1SEL)
+#define VT6655_MAC_SELECT_PAGE1(iobase) iowrite8(1, iobase + MAC_REG_PAGE1SEL)
#define MACvSetRFLE_LatchBase(iobase) \
vt6655_mac_word_reg_bits_on(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/9] staging: vt6655: Replace macro MACvSetRFLE_LatchBase
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (4 preceding siblings ...)
2022-08-28 6:54 ` [PATCH 5/9] staging: vt6655: Rename macro MACvSelectPage1 Philipp Hortmann
@ 2022-08-28 6:54 ` Philipp Hortmann
2022-08-28 6:54 ` [PATCH 7/9] staging: vt6655: Rename function MACbIsRegBitsOff Philipp Hortmann
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:54 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Replace macro MACvSetRFLE_LatchBase with the called function as it is
just used once and to avoid CamelCase which is not accepted by
checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/baseband.c | 2 +-
drivers/staging/vt6655/mac.h | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c
index 5de841cb776c..6ce41983dcf4 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -2083,7 +2083,7 @@ bool bb_vt3253_init(struct vnt_private *priv)
priv->dbm_threshold[2] = 0;
priv->dbm_threshold[3] = 0;
/* Fix VT3226 DFC system timing issue */
- MACvSetRFLE_LatchBase(iobase);
+ vt6655_mac_word_reg_bits_on(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT);
/* {{ RobertYu: 20050104 */
} else {
/* No VGA Table now */
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 3af8abc305b1..2af243b9389f 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -541,9 +541,6 @@
#define VT6655_MAC_SELECT_PAGE1(iobase) iowrite8(1, iobase + MAC_REG_PAGE1SEL)
-#define MACvSetRFLE_LatchBase(iobase) \
- vt6655_mac_word_reg_bits_on(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
-
#define MAKEWORD(lb, hb) \
((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8)))
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/9] staging: vt6655: Rename function MACbIsRegBitsOff
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (5 preceding siblings ...)
2022-08-28 6:54 ` [PATCH 6/9] staging: vt6655: Replace macro MACvSetRFLE_LatchBase Philipp Hortmann
@ 2022-08-28 6:54 ` Philipp Hortmann
2022-08-28 6:54 ` [PATCH 8/9] staging: vt6655: Delete function MACbIsIntDisable Philipp Hortmann
2022-08-28 6:54 ` [PATCH 9/9] staging: vt6655: Rename function MACvSetShortRetryLimit Philipp Hortmann
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:54 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Remove declaration of MACbIsRegBitsOff as it is not needed. Rename
function MACbIsRegBitsOff to vt6655_mac_is_reg_bits_off, rename
byRegOfs to reg_offset and byTestBits to mask to avoid CamelCase which
is not accepted by checkpatch.pl. Made function static to keep namespace
clean.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 15 ++++++++-------
drivers/staging/vt6655/mac.h | 3 ---
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 742391b24afb..7363dfb04ba8 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -10,7 +10,7 @@
* Date: May 21, 1996
*
* Functions:
- * MACbIsRegBitsOff - Test if All test Bits Off
+ * vt6655_mac_is_reg_bits_off - Test if All test Bits Off
* MACbIsIntDisable - Test if MAC interrupt disable
* MACvSetShortRetryLimit - Set 802.11 Short Retry limit
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
@@ -86,20 +86,21 @@ static void vt6655_mac_clear_stck_ds(void __iomem *iobase)
* Parameters:
* In:
* io_base - Base Address for MAC
- * byRegOfs - Offset of MAC Register
- * byTestBits - Test bits
+ * reg_offset - Offset of MAC Register
+ * mask - Test bits
* Out:
* none
*
* Return Value: true if all test bits Off; otherwise false
*
*/
-bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
- unsigned char byTestBits)
+static bool vt6655_mac_is_reg_bits_off(struct vnt_private *priv,
+ unsigned char reg_offset,
+ unsigned char mask)
{
void __iomem *io_base = priv->port_offset;
- return !(ioread8(io_base + byRegOfs) & byTestBits);
+ return !(ioread8(io_base + reg_offset) & mask);
}
/*
@@ -767,7 +768,7 @@ bool MACbPSWakeup(struct vnt_private *priv)
void __iomem *io_base = priv->port_offset;
unsigned int ww;
/* Read PSCTL */
- if (MACbIsRegBitsOff(priv, MAC_REG_PSCTL, PSCTL_PS))
+ if (vt6655_mac_is_reg_bits_off(priv, MAC_REG_PSCTL, PSCTL_PS))
return true;
/* Disable PS */
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 2af243b9389f..ca1211aacec2 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -549,9 +549,6 @@ void vt6655_mac_word_reg_bits_on(void __iomem *iobase, const u8 reg_offset, cons
void vt6655_mac_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u8 bit_mask);
void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u16 bit_mask);
-bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs,
- unsigned char byTestBits);
-
bool MACbIsIntDisable(struct vnt_private *priv);
void MACvSetShortRetryLimit(struct vnt_private *priv,
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/9] staging: vt6655: Delete function MACbIsIntDisable
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (6 preceding siblings ...)
2022-08-28 6:54 ` [PATCH 7/9] staging: vt6655: Rename function MACbIsRegBitsOff Philipp Hortmann
@ 2022-08-28 6:54 ` Philipp Hortmann
2022-08-28 6:54 ` [PATCH 9/9] staging: vt6655: Rename function MACvSetShortRetryLimit Philipp Hortmann
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:54 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Delete function MACbIsIntDisable as it is unused and the name is not
accepted by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/mac.c | 24 ------------------------
drivers/staging/vt6655/mac.h | 2 --
2 files changed, 26 deletions(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index 7363dfb04ba8..edd941c4f9ee 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -11,7 +11,6 @@
*
* Functions:
* vt6655_mac_is_reg_bits_off - Test if All test Bits Off
- * MACbIsIntDisable - Test if MAC interrupt disable
* MACvSetShortRetryLimit - Set 802.11 Short Retry limit
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
* MACvSetLoopbackMode - Set MAC Loopback Mode
@@ -103,29 +102,6 @@ static bool vt6655_mac_is_reg_bits_off(struct vnt_private *priv,
return !(ioread8(io_base + reg_offset) & mask);
}
-/*
- * Description:
- * Test if MAC interrupt disable
- *
- * Parameters:
- * In:
- * io_base - Base Address for MAC
- * Out:
- * none
- *
- * Return Value: true if interrupt is disable; otherwise false
- *
- */
-bool MACbIsIntDisable(struct vnt_private *priv)
-{
- void __iomem *io_base = priv->port_offset;
-
- if (ioread32(io_base + MAC_REG_IMR))
- return false;
-
- return true;
-}
-
/*
* Description:
* Set 802.11 Short Retry Limit
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index ca1211aacec2..cc5d2493375b 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -549,8 +549,6 @@ void vt6655_mac_word_reg_bits_on(void __iomem *iobase, const u8 reg_offset, cons
void vt6655_mac_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u8 bit_mask);
void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u16 bit_mask);
-bool MACbIsIntDisable(struct vnt_private *priv);
-
void MACvSetShortRetryLimit(struct vnt_private *priv,
unsigned char byRetryLimit);
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 9/9] staging: vt6655: Rename function MACvSetShortRetryLimit
2022-08-28 6:52 [PATCH 0/9] staging: vt6655: Improve coding style in mac.h Philipp Hortmann
` (7 preceding siblings ...)
2022-08-28 6:54 ` [PATCH 8/9] staging: vt6655: Delete function MACbIsIntDisable Philipp Hortmann
@ 2022-08-28 6:54 ` Philipp Hortmann
8 siblings, 0 replies; 10+ messages in thread
From: Philipp Hortmann @ 2022-08-28 6:54 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename function MACvSetShortRetryLimit to vt6655_mac_set_short_retry_limit
and byRetryLimit to retry_limit to avoid CamelCase which is not accepted
by checkpatch.pl.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/vt6655/device_main.c | 2 +-
drivers/staging/vt6655/mac.c | 9 ++++-----
drivers/staging/vt6655/mac.h | 3 +--
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index cd748b1665bb..3397c78b975a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -412,7 +412,7 @@ static void device_init_registers(struct vnt_private *priv)
(CFG_TKIPOPT | CFG_NOTXTIMEOUT));
/* set performance parameter by registry */
- MACvSetShortRetryLimit(priv, priv->byShortRetryLimit);
+ vt6655_mac_set_short_retry_limit(priv, priv->byShortRetryLimit);
MACvSetLongRetryLimit(priv, priv->byLongRetryLimit);
/* reset TSF counter */
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index edd941c4f9ee..d056df1220d3 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -11,7 +11,7 @@
*
* Functions:
* vt6655_mac_is_reg_bits_off - Test if All test Bits Off
- * MACvSetShortRetryLimit - Set 802.11 Short Retry limit
+ * vt6655_mac_set_short_retry_limit - Set 802.11 Short Retry limit
* MACvSetLongRetryLimit - Set 802.11 Long Retry limit
* MACvSetLoopbackMode - Set MAC Loopback Mode
* MACvSaveContext - Save Context of MAC Registers
@@ -109,19 +109,18 @@ static bool vt6655_mac_is_reg_bits_off(struct vnt_private *priv,
* Parameters:
* In:
* io_base - Base Address for MAC
- * byRetryLimit- Retry Limit
+ * retry_limit - Retry Limit
* Out:
* none
*
* Return Value: none
*
*/
-void MACvSetShortRetryLimit(struct vnt_private *priv,
- unsigned char byRetryLimit)
+void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char retry_limit)
{
void __iomem *io_base = priv->port_offset;
/* set SRT */
- iowrite8(byRetryLimit, io_base + MAC_REG_SRT);
+ iowrite8(retry_limit, io_base + MAC_REG_SRT);
}
/*
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index cc5d2493375b..a70e75ff78cd 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -549,8 +549,7 @@ void vt6655_mac_word_reg_bits_on(void __iomem *iobase, const u8 reg_offset, cons
void vt6655_mac_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u8 bit_mask);
void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, const u16 bit_mask);
-void MACvSetShortRetryLimit(struct vnt_private *priv,
- unsigned char byRetryLimit);
+void vt6655_mac_set_short_retry_limit(struct vnt_private *priv, unsigned char retry_limit);
void MACvSetLongRetryLimit(struct vnt_private *priv, unsigned char byRetryLimit);
--
2.37.2
^ permalink raw reply related [flat|nested] 10+ messages in thread