* [PATCH v2 0/2] staging: vt6655: Convert multiline macro to static function
@ 2022-07-28 5:59 Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 1/2] staging: vt6655: Rename MACvClearStckDS Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 2/2] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function Philipp Hortmann
0 siblings, 2 replies; 3+ messages in thread
From: Philipp Hortmann @ 2022-07-28 5:59 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
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(-)
--
2.37.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] staging: vt6655: Rename MACvClearStckDS
2022-07-28 5:59 [PATCH v2 0/2] staging: vt6655: Convert multiline macro to static function Philipp Hortmann
@ 2022-07-28 5:59 ` Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 2/2] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function Philipp Hortmann
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Hortmann @ 2022-07-28 5:59 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Rename MACvClearStckDS macro to vt6655_mac_clear_stck_ds 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>
---
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(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index a7f645f9ccf8..d7ee42df7062 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -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 */
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index e2ef8c6ef7b7..3d6d53d5b383 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -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); \
--
2.37.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
2022-07-28 5:59 [PATCH v2 0/2] staging: vt6655: Convert multiline macro to static function Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 1/2] staging: vt6655: Rename MACvClearStckDS Philipp Hortmann
@ 2022-07-28 5:59 ` Philipp Hortmann
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Hortmann @ 2022-07-28 5:59 UTC (permalink / raw)
To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel
Convert 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.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
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(-)
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index d7ee42df7062..dcc649532737 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -70,6 +70,15 @@ void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, con
iowrite16(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
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 3d6d53d5b383..467c599a3289 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -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)
--
2.37.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-28 5:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-28 5:59 [PATCH v2 0/2] staging: vt6655: Convert multiline macro to static function Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 1/2] staging: vt6655: Rename MACvClearStckDS Philipp Hortmann
2022-07-28 5:59 ` [PATCH v2 2/2] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).