mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 v2 6/6] staging: vt6655: Convert macro MACvDisableBarkerPreambleMd
Date: Sun, 7 Aug 2022 20:13:55 +0200	[thread overview]
Message-ID: <2a1d67762d9ecf3f30f3e293ad6ab997ad278b84.1659892671.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1659892670.git.philipp.g.hortmann@gmail.com>

Convert macro MACvDisableBarkerPreambleMd to static function which calls
the common static function vt6655_mac_clear_bits. 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>
---
V1 -> V2: Changed used function to vt6655_mac_clear_bits
---
 drivers/staging/vt6655/device_main.c | 8 +++++++-
 drivers/staging/vt6655/mac.h         | 8 --------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 46bd88ee4668..8e2a976aaaad 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -248,6 +248,12 @@ static void vt6655_mac_en_barker_preamble_md(void __iomem *iobase)
 {
 	vt6655_mac_set_bits(iobase, ENCFG_BARKERPREAM);
 }
+
+static void vt6655_mac_dis_barker_preamble_md(void __iomem *iobase)
+{
+	vt6655_mac_clear_bits(iobase, ENCFG_BARKERPREAM);
+}
+
 /*
  * Initialisation of MAC & BBP registers
  */
@@ -1486,7 +1492,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 3400ea15b673..a75cd318ee25 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -543,14 +543,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


      parent reply	other threads:[~2022-08-07 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 18:13 [PATCH v2 0/6] staging: vt6655: Create two base functions for four macros Philipp Hortmann
2022-08-07 18:13 ` [PATCH v2 1/6] staging: vt6655: Convert macro MACvEnableProtectMD to function Philipp Hortmann
2022-08-07 18:13 ` [PATCH v2 2/6] staging: vt6655: Create one function for two macros Philipp Hortmann
2022-08-07 18:13 ` [PATCH v2 3/6] staging: vt6655: Rename function MACvEnableProtectMD Philipp Hortmann
2022-08-07 18:13 ` [PATCH v2 4/6] staging: vt6655: Convert macro MACvDisableProtectMD Philipp Hortmann
2022-08-07 18:13 ` [PATCH v2 5/6] staging: vt6655: Convert macro MACvEnableBarkerPreambleMd Philipp Hortmann
2022-08-07 18:13 ` Philipp Hortmann [this message]

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=2a1d67762d9ecf3f30f3e293ad6ab997ad278b84.1659892671.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®