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 4/6] staging: vt6655: Convert macro MACvDisableProtectMD
Date: Sat, 30 Jul 2022 21:20:49 +0200 [thread overview]
Message-ID: <a04c74251d82a0f8eaa1e92990cb215465aae41f.1659192760.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1659192760.git.philipp.g.hortmann@gmail.com>
Convert macro MACvDisableProtectMD 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@gmail.com>
---
drivers/staging/vt6655/device_main.c | 7 ++++++-
drivers/staging/vt6655/mac.h | 10 +---------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 7633602e47c1..c09d80effc3f 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -233,6 +233,11 @@ static void vt6655_mac_en_protect_md(void __iomem *iobase)
vt6655_mac_en_dis_bits_u32_reg(iobase, ENABLE, ENCFG_PROTECTMD);
}
+static void vt6655_mac_dis_protect_md(void __iomem *iobase)
+{
+ vt6655_mac_en_dis_bits_u32_reg(iobase, DISABLE, ENCFG_PROTECTMD);
+}
+
/*
* Initialisation of MAC & BBP registers
*/
@@ -1480,7 +1485,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
if (conf->use_cts_prot)
vt6655_mac_en_protect_md(priv->port_offset);
else
- MACvDisableProtectMD(priv->port_offset);
+ vt6655_mac_dis_protect_md(priv->port_offset);
}
if (changed & BSS_CHANGED_ERP_SLOT) {
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 66e03e8173ea..3a9721624cff 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -12,7 +12,7 @@
* Revision History:
* 07-01-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
* 08-25-2003 Kyle Hsu: Porting MAC functions from sim53.
- * 09-03-2003 Bryan YC Fan: Add MACvDisableProtectMD & vt6655_mac_en_protect_md
+ * 09-03-2003 Bryan YC Fan: Add vt6655_mac_dis_protect_md & vt6655_mac_en_protect_md
*/
#ifndef __MAC_H__
@@ -546,14 +546,6 @@
#define MACvSelectPage1(iobase) \
iowrite8(1, iobase + MAC_REG_PAGE1SEL)
-#define MACvDisableProtectMD(iobase) \
-do { \
- unsigned long dwOrgValue; \
- dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \
- dwOrgValue = dwOrgValue & ~ENCFG_PROTECTMD; \
- iowrite32((u32)dwOrgValue, iobase + MAC_REG_ENCFG); \
-} while (0)
-
#define MACvEnableBarkerPreambleMd(iobase) \
do { \
unsigned long dwOrgValue; \
--
2.37.1
next prev parent reply other threads:[~2022-07-30 19:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-30 19:20 [PATCH 0/6] staging: vt6655: Create one base function for four macros Philipp Hortmann
2022-07-30 19:20 ` [PATCH 1/6] staging: vt6655: Convert macro MACvEnableProtectMD to function Philipp Hortmann
2022-07-30 19:20 ` [PATCH 2/6] staging: vt6655: Create one function for four macros Philipp Hortmann
2022-08-01 11:21 ` Dan Carpenter
2022-07-30 19:20 ` [PATCH 3/6] staging: vt6655: Rename function MACvEnableProtectMD Philipp Hortmann
2022-07-30 19:20 ` Philipp Hortmann [this message]
2022-07-30 19:20 ` [PATCH 5/6] staging: vt6655: Convert macro MACvEnableBarkerPreambleMd Philipp Hortmann
2022-07-30 19:21 ` [PATCH 6/6] staging: vt6655: Convert macro MACvDisableBarkerPreambleMd 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=a04c74251d82a0f8eaa1e92990cb215465aae41f.1659192760.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
all inboxes | Powered by JetHome®