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-next>] [day] [month] [year] [list]
Date:   Tue, 21 Mar 2023 17:11:41 +0530
From:   Inshal Khan <kziaul123@...il.com>
To:     gregkh@...uxfoundation.org
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] Staging: rtl8712: osdep_intf: Improve RND4 macro for
 better debugging and safety

This commit modifies the RND4_UPPER macro in the osdep_intf module of
the rtl8712 driver to improve its safety and debugging capabilities.
The macro has been changed to use a temporary variable for the input
argument 'x', instead of directly using it in the macro expression.
This change helps to avoid potential issues with operator precedence
and unexpected side effects that could occur if 'x' was reused within
the macro.

Additionally, the new definition of the macro uses the 'typeof' operator
to determine the type of the input argument, which ensures that the macro
can handle any data type safely. The new definition also uses a block
expression to contain the macro code, allowing for better debugging
capabilities and cleaner code.

This change improves the safety and maintainability of the RND4 macro
and makes it more suitable for use in the Linux kernel.

Signed-off-by: Inshal Khan <kziaul123@...il.com>
---
 drivers/staging/rtl8712/osdep_intf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/osdep_intf.h b/drivers/staging/rtl8712/osdep_intf.h
index 95a21f380cd7..0e097b4a8670 100644
--- a/drivers/staging/rtl8712/osdep_intf.h
+++ b/drivers/staging/rtl8712/osdep_intf.h
@@ -18,8 +18,8 @@
 #include "drv_types.h"
 
 #define RND4(x)	({ \
-		typeof(x) _x = (x); \
-		(((_x) + 3) & ~3); \
+			typeof(x) _x = (x); \
+			(((_x) + 3) & ~3); \
 		})
 
 struct intf_priv {
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ