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]
Date:   Sun, 29 Jul 2018 22:07:44 +0100
From:   John Whitmore <johnfwhitmore@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     devel@...verdev.osuosl.org, gregkh@...uxfoundation.org,
        John Whitmore <johnfwhitmore@...il.com>
Subject: [PATCH v2 12/15] staging:rtl8192u: Refactor dm_dig_connect_e - Style

The enumerated type dm_dig_connect_e is only used to group constant
values, as the actual type is never used as the type for the variables
which use the defined constants (cur_connect_state and pre_connect_state).

These two member variables have had there defined types changed to
properly reflect there usage and to permit compiler type checks to be
performed.

In addition the definition of the enumerated type has been moved above
the structure which uses the type. The typedef of the enumerated type
has been removed to clear the checkpatch issue with defining new types
and the enumerated value DIG_CONNECT_MAX has been removed since it is
never used in code.

The resulting changes are all coding style in nature and should not
impact runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@...il.com>
---
 drivers/staging/rtl8192u/r8192U_dm.h | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index c15faa428b1d..8de6d15fb659 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -76,6 +76,11 @@ enum dynamic_init_gain_state {
 	DM_STA_DIG_MAX
 };
 
+enum dig_connect {
+	DIG_DISCONNECT = 0,
+	DIG_CONNECT = 1,
+};
+
 /* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */
 struct dig {
 	u8		dig_enable_flag;
@@ -91,8 +96,8 @@ struct dig {
 
 	enum dynamic_init_gain_state		dig_state;
 	enum dynamic_init_gain_state		dig_highpwr_state;
-	u8		cur_connect_state;
-	u8		pre_connect_state;
+	enum dig_connect		cur_connect_state;
+	enum dig_connect		pre_connect_state;
 
 	u8		curpd_thstate;
 	u8		prepd_thstate;
@@ -110,12 +115,6 @@ struct dig {
 	long		rssi_val;
 };
 
-typedef enum tag_dig_connect_definition {
-	DIG_DISCONNECT = 0,
-	DIG_CONNECT = 1,
-	DIG_CONNECT_MAX
-} dm_dig_connect_e;
-
 typedef enum tag_dig_packetdetection_threshold_definition {
 	DIG_PD_AT_LOW_POWER = 0,
 	DIG_PD_AT_NORMAL_POWER = 1,
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ