From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Forest Bond <forest@alittletooquiet.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 2/9] staging: vt6655: Convert macro MACvSetBBType to function
Date: Sun, 28 Aug 2022 08:53:29 +0200 [thread overview]
Message-ID: <bd512f940427615ed4b134dd04f14095875eec5b.1661666677.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1661666677.git.philipp.g.hortmann@gmail.com>
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
next prev parent reply other threads:[~2022-08-28 6:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-08-28 6:53 ` [PATCH 3/9] staging: vt6655: Rename function MACvSetBBType Philipp Hortmann
2022-08-28 6:53 ` [PATCH 4/9] staging: vt6655: Rename macro MACvSelectPage0 Philipp Hortmann
2022-08-28 6:54 ` [PATCH 5/9] staging: vt6655: Rename macro MACvSelectPage1 Philipp Hortmann
2022-08-28 6:54 ` [PATCH 6/9] staging: vt6655: Replace macro MACvSetRFLE_LatchBase Philipp Hortmann
2022-08-28 6:54 ` [PATCH 7/9] staging: vt6655: Rename function MACbIsRegBitsOff 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bd512f940427615ed4b134dd04f14095875eec5b.1661666677.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).