Skip to content

Commit c528bbb

Browse files
Philipp Hortmanngregkh
authored andcommitted
staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function
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>
1 parent 8993367 commit c528bbb

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

drivers/staging/vt6655/mac.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ void vt6655_mac_word_reg_bits_off(void __iomem *iobase, const u8 reg_offset, con
7070
iowrite16(reg_value & ~(bit_mask), iobase + reg_offset);
7171
}
7272

73+
static void vt6655_mac_clear_stck_ds(void __iomem *iobase)
74+
{
75+
u8 reg_value;
76+
77+
reg_value = ioread8(iobase + MAC_REG_STICKHW);
78+
reg_value = reg_value & 0xFC;
79+
iowrite8(reg_value, iobase + MAC_REG_STICKHW);
80+
}
81+
7382
/*
7483
* Description:
7584
* Test if all test bits off

drivers/staging/vt6655/mac.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,6 @@ do { \
577577
iowrite32(DMACTL_RUN, iobase + MAC_REG_AC0DMACTL); \
578578
} while (0)
579579

580-
#define vt6655_mac_clear_stck_ds(iobase) \
581-
do { \
582-
unsigned char byOrgValue; \
583-
byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \
584-
byOrgValue = byOrgValue & 0xFC; \
585-
iowrite8(byOrgValue, iobase + MAC_REG_STICKHW); \
586-
} while (0)
587-
588580
#define MACvSelectPage0(iobase) \
589581
iowrite8(0, iobase + MAC_REG_PAGE1SEL)
590582

0 commit comments

Comments
 (0)