staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Thu, 28 Jul 2022 05:59:45 +0000 (07:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jul 2022 08:43:24 +0000 (10:43 +0200)
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>
Link: https://lore.kernel.org/r/cbfe5cc170b68564ff45bb7f45c63de241c2a664.1658986804.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/mac.c
drivers/staging/vt6655/mac.h

index d7ee42df70627d6b741606ca362f78d944d348fc..dcc649532737d8b390750645597e12324b25bee5 100644 (file)
@@ -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
index fc587244a70db51d81c3b64af1f95a0bc6507672..0122c4603c6646882a71d1480500300f5aa75e9d 100644 (file)
@@ -577,14 +577,6 @@ do {                                                                       \
                iowrite32(DMACTL_RUN, iobase + MAC_REG_AC0DMACTL);      \
 } while (0)
 
-#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)