staging: vt6655: Convert macro MACvEnableProtectMD to function
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 7 Aug 2022 18:13:33 +0000 (20:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2022 13:10:41 +0000 (15:10 +0200)
Convert macro to static function. Multiline macros are not liked by
kernel community. Rename variable dwOrgValue to reg_value 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>
Link: https://lore.kernel.org/r/f3a5ec5352346f1dc4bf3afbee25973fdb47d7e4.1659892670.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/device_main.c
drivers/staging/vt6655/mac.h

index 8db655742bd41ce11cbae16f82aa56f6b70dea4c..ab6456fc2b3fd3256bdc82b92825588c244fb623 100644 (file)
@@ -216,6 +216,15 @@ static void vt6655_mac_dma_ctl(void __iomem *iobase, u8 reg_index)
                iowrite32(DMACTL_RUN, iobase + reg_index);
 }
 
+static void MACvEnableProtectMD(void __iomem *iobase)
+{
+       u32 reg_value;
+
+       reg_value = ioread32(iobase + MAC_REG_ENCFG);
+       reg_value = reg_value | ENCFG_PROTECTMD;
+       iowrite32(reg_value, iobase + MAC_REG_ENCFG);
+}
+
 /*
  * Initialisation of MAC & BBP registers
  */
index 467c599a32894093f20c7399b265a48a5a3d2c2b..84d203c56b1ff3fdbc096b9146d022862f465ddd 100644 (file)
 #define MACvSelectPage1(iobase)                                \
        iowrite8(1, iobase + MAC_REG_PAGE1SEL)
 
-#define MACvEnableProtectMD(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 MACvDisableProtectMD(iobase)                                   \
 do {                                                                   \
        unsigned long dwOrgValue;                                       \