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 2/2] staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
Date: Thu, 28 Jul 2022 07:59:45 +0200 [thread overview]
Message-ID: <cbfe5cc170b68564ff45bb7f45c63de241c2a664.1658986804.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1658986804.git.philipp.g.hortmann@gmail.com>
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
prev parent reply other threads:[~2022-07-28 6:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [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=cbfe5cc170b68564ff45bb7f45c63de241c2a664.1658986804.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®