diff options
author | Philipp Hortmann <philipp.g.hortmann@gmail.com> | 2022-08-07 20:13:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-16 15:10:41 +0200 |
commit | cc00269153b870895baaad9f74034b8ae8803d7a (patch) | |
tree | 9824991dc181f258ca2fc0e4df627c1ebdbacf49 /drivers | |
parent | 17ca653712765ecefff6136b863895382e5989e8 (diff) | |
download | linux-cc00269153b870895baaad9f74034b8ae8803d7a.tar.gz linux-cc00269153b870895baaad9f74034b8ae8803d7a.tar.bz2 linux-cc00269153b870895baaad9f74034b8ae8803d7a.zip |
staging: vt6655: Convert macro MACvDisableProtectMD
Convert macro MACvDisableProtectMD to static function which calls the
new 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>
Link: https://lore.kernel.org/r/4cb2b8025adde2a3addfd8e954faf18a0a8032aa.1659892670.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 16 | ||||
-rw-r--r-- | drivers/staging/vt6655/mac.h | 10 |
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index ccfd4bfa0502..96945fb8d536 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -225,11 +225,25 @@ static void vt6655_mac_set_bits(void __iomem *iobase, u32 mask) iowrite32(reg_value, iobase + MAC_REG_ENCFG); } +static void vt6655_mac_clear_bits(void __iomem *iobase, u32 mask) +{ + u32 reg_value; + + reg_value = ioread32(iobase + MAC_REG_ENCFG); + reg_value = reg_value & ~mask; + iowrite32(reg_value, iobase + MAC_REG_ENCFG); +} + static void vt6655_mac_en_protect_md(void __iomem *iobase) { vt6655_mac_set_bits(iobase, ENCFG_PROTECTMD); } +static void vt6655_mac_dis_protect_md(void __iomem *iobase) +{ + vt6655_mac_clear_bits(iobase, ENCFG_PROTECTMD); +} + /* * Initialisation of MAC & BBP registers */ @@ -1477,7 +1491,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, if (conf->use_cts_prot) vt6655_mac_en_protect_md(priv->port_offset); else - MACvDisableProtectMD(priv->port_offset); + vt6655_mac_dis_protect_md(priv->port_offset); } if (changed & BSS_CHANGED_ERP_SLOT) { diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h index 4de9974e6c69..a7d6254fded0 100644 --- a/drivers/staging/vt6655/mac.h +++ b/drivers/staging/vt6655/mac.h @@ -12,7 +12,7 @@ * Revision History: * 07-01-2003 Bryan YC Fan: Re-write codes to support VT3253 spec. * 08-25-2003 Kyle Hsu: Porting MAC functions from sim53. - * 09-03-2003 Bryan YC Fan: Add MACvDisableProtectMD & vt6655_mac_en_protect_md + * 09-03-2003 Bryan YC Fan: Add vt6655_mac_dis_protect_md & vt6655_mac_en_protect_md */ #ifndef __MAC_H__ @@ -543,14 +543,6 @@ #define MACvSelectPage1(iobase) \ iowrite8(1, iobase + MAC_REG_PAGE1SEL) -#define MACvDisableProtectMD(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 MACvEnableBarkerPreambleMd(iobase) \ do { \ unsigned long dwOrgValue; \ |