[PATCH 6/6] staging: vt6655: Convert macro MACvDisableBarkerPreambleMd

From: Philipp Hortmann
Date: Sat Jul 30 2022 - 15:21:22 EST


Convert macro MACvDisableBarkerPreambleMd to static function which calls
the common static function vt6655_mac_en_dis_bits_u32_reg. This saves
codelines and multiline macros are not liked by kernel community.
Function name is also changed to avoid CamelCase which is not accepted
by checkpatch.pl and to clean up namespace.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@xxxxxxxxx>
---
drivers/staging/vt6655/device_main.c | 7 ++++++-
drivers/staging/vt6655/mac.h | 8 --------
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 5ca8a302011d..6efa79e8a651 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -243,6 +243,11 @@ static void vt6655_mac_en_barker_preamble_md(void __iomem *iobase)
vt6655_mac_en_dis_bits_u32_reg(iobase, ENABLE, ENCFG_BARKERPREAM);
}

+static void vt6655_mac_dis_barker_preamble_md(void __iomem *iobase)
+{
+ vt6655_mac_en_dis_bits_u32_reg(iobase, DISABLE, ENCFG_BARKERPREAM);
+}
+
/*
* Initialisation of MAC & BBP registers
*/
@@ -1481,7 +1486,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
vt6655_mac_en_barker_preamble_md(priv->port_offset);
priv->preamble_type = true;
} else {
- MACvDisableBarkerPreambleMd(priv->port_offset);
+ vt6655_mac_dis_barker_preamble_md(priv->port_offset);
priv->preamble_type = false;
}
}
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index fd95f49aa739..012388bf8d3b 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -546,14 +546,6 @@
#define MACvSelectPage1(iobase) \
iowrite8(1, iobase + MAC_REG_PAGE1SEL)

-#define MACvDisableBarkerPreambleMd(iobase) \
-do { \
- unsigned long dwOrgValue; \
- dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \
- dwOrgValue = dwOrgValue & ~ENCFG_BARKERPREAM; \
- iowrite32((u32)dwOrgValue, iobase + MAC_REG_ENCFG); \
-} while (0)
-
#define MACvSetBBType(iobase, byTyp) \
do { \
unsigned long dwOrgValue; \
--
2.37.1