lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221006230757.33369-1-bpappas@pappasbrent.com>
Date:   Thu,  6 Oct 2022 19:07:57 -0400
From:   Brent Pappas <bpappas@...pasbrent.com>
To:     namcaov@...il.com
Cc:     cai.huoqing@...ux.dev, gregkh@...uxfoundation.org, kuba@...nel.org,
        linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
        pappasbrent@...ghts.ucf.edu, Brent Pappas <bpappas@...pasbrent.com>
Subject: [PATCH v3] Replace macros HB and LB with static inline functions

Replace function-like macros "HB" and "LB" with static inline functions
to comply with preferred Linux coding style standards.

Signed-off-by: Brent Pappas <bpappas@...pasbrent.com>
---
Changelog:
V1 -> V2: Resent diff from a mail client that would not replace tabs
          with spaces so that patch can be successfully applied.
V2 -> V3: Created patch using git format-patch.
		  Tested downloading and applying patch.
          Sent patch using git send-email.

 drivers/staging/most/net/net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 1d1fe8bff7ee..8a8fbc274b73 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -36,8 +36,8 @@
 #define PMS_TELID_MASK		0x0F
 #define PMS_TELID_SHIFT		4
 
-#define HB(value)		((u8)((u16)(value) >> 8))
-#define LB(value)		((u8)(value))
+static inline u8 HB(unsigned int value)		{ return ((u8)((u16)(value) >> 8)); }
+static inline u8 LB(unsigned int value)		{ return ((u8)(value)); }
 
 #define EXTRACT_BIT_SET(bitset_name, value) \
 	(((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ