staging: vt6655: Convert multiline macro to static function
v2 cover staging: vt6655: Convert multiline macro to static function
Convert multiline macro to static function. Multiline macros are not liked by kernel community.
Tested with vt6655 on mini PCI Module Transferred this patch over wlan connection of vt6655
V1 -> V2: Combined patch "Rename byOrgValue to reg_value in a macro" with
patch "Convert macro vt6655_mac_clear_stck_ds to function" Improved to early line breaks in patch descriptions Removed function declaration of vt6655_mac_clear_stck_ds Changed variable declaration in vt6655_mac_clear_stck_ds
Philipp Hortmann (2):
staging: vt6655: Rename MACvClearStckDS
staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
drivers/staging/vt6655/mac.c | 11 ++++++++++- drivers/staging/vt6655/mac.h | 8 -------- 2 files changed, 10 insertions(+), 9 deletions(-)
Signature · 1 line
2.37.1
PATCH v2 1/2 staging: vt6655: Rename MACvClearStckDS
Rename MACvClearStckDS macro to vt6655_mac_clear_stck_ds to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace.
---
V1 -> v2: Improved to early line breaks in description
Improved description
--- drivers/staging/vt6655/mac.c | 2 +- drivers/staging/vt6655/mac.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6655/mac.c +1 -1
@@ -518,7 +518,7 @@ void MACvInitialize(struct vnt_private *priv) {void __iomem *io_base = priv->port_offset;/* clear sticky bits */ -MACvClearStckDS (io_base); +vt6655_mac_clear_stck_ds (io_base);/* disable force PME-enable */ iowrite8 (PME_OVR , io_base +MAC_REG_PMC1 );/* only 3253 A */
drivers/staging/vt6655/mac.h +1 -1
@@ -537,7 +537,7 @@/*--------------------- Export Macros ------------------------------*/ -#define MACvClearStckDS (iobase) \ +#define vt6655_mac_clear_stck_ds (iobase) \ do { \ unsigned char byOrgValue; \ byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \
Signature · 1 line
2.37.1
PATCH v2 2/2 staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
In reply to Philipp HortmannConvert once used macro to static function. Multiline macros are not liked by kernel community. Rename variable byOrgValue to reg_value to avoid CamelCase which is not accepted by checkpatch.pl. Change variable declaration to u8 as this improves readability.
---
V1 -> V2: Combind patch "Rename byOrgValue to reg_val..." with this one
Removed function declaration
Changed variable declaration
Improved patch description
--- drivers/staging/vt6655/mac.c | 9 +++++++++ drivers/staging/vt6655/mac.h | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-)
drivers/staging/vt6655/mac.c +9 -0
@@ -70,6 +70,15 @@ void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, coniowrite16 (reg_value & ~(bit_mask), iobase + reg_offset); } +static void vt6655_mac_clear_stck_ds (void __iomem *iobase) +{ +u8 reg_value; + + reg_value =ioread8 (iobase +MAC_REG_STICKHW ); + reg_value = reg_value &0xFC ; +iowrite8 (reg_value, iobase +MAC_REG_STICKHW ); +} +/* * Description: * Test if all test bits off
drivers/staging/vt6655/mac.h +0 -8
@@ -537,14 +537,6 @@/*--------------------- Export Macros ------------------------------*/ -#define vt6655_mac_clear_stck_ds (iobase) \ -do { \ - unsigned char byOrgValue; \ - byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \ - byOrgValue = byOrgValue & 0xFC; \ - iowrite8(byOrgValue, iobase + MAC_REG_STICKHW); \ -} while (0) -#define MACvSelectPage0 (iobase) \ iowrite8(0, iobase + MAC_REG_PAGE1SEL)
Signature · 1 line
2.37.1