staging: rtl8187se: Convert _WIRELESS_MODE into a enum.
authorAna Rey <anarey@gmail.com>
Mon, 10 Mar 2014 17:56:44 +0000 (18:56 +0100)
committerPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Thu, 13 Mar 2014 22:41:42 +0000 (15:41 -0700)
The Documentation/CodingStyle doesn't recommend the use of typedef,
convert this to enum.

While at it, I have also renamed the variable names that were used in
this typedef not to use Hungarian notation.

Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
drivers/staging/rtl8187se/r8180.h
drivers/staging/rtl8187se/r8180_rtl8225z2.c
drivers/staging/rtl8187se/r8185b_init.c

index 00e38b5cb1be96eaaa5dfec5cf32cfad0a213198..9e4b5450ceb7b97c1851c3dd9671f5b7eb52d5b3 100644 (file)
 /* +by amy 080312. */
 #define RATE_ADAPTIVE_TIMER_PERIOD 300
 
-typedef enum _WIRELESS_MODE {
+enum wireless_mode {
        WIRELESS_MODE_UNKNOWN = 0x00,
        WIRELESS_MODE_A = 0x01,
        WIRELESS_MODE_B = 0x02,
        WIRELESS_MODE_G = 0x04,
        WIRELESS_MODE_AUTO = 0x08,
-} WIRELESS_MODE;
+};
 
 struct chnl_access_setting {
        u16 sifs_timer;
index 7c9a8bfe6d889c2f0ec3e89cc16192bdb2f0d309..0677ae37d70c2007fd71d73adf599d93fbe2fa17 100644 (file)
@@ -279,8 +279,8 @@ void rtl8225z2_rf_close(struct net_device *dev)
  * Map dBm into Tx power index according to current HW model, for example,
  * RF and PA, and current wireless mode.
  */
-static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
-                       s32 PowerInDbm)
+static s8 DbmToTxPwrIdx(struct r8180_priv *priv,
+                       enum wireless_mode mode, s32 PowerInDbm)
 {
        bool bUseDefault = true;
        s8 TxPwrIdx = 0;
@@ -291,7 +291,7 @@ static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
         */
        s32 tmp = 0;
 
-       if (WirelessMode == WIRELESS_MODE_G) {
+       if (mode == WIRELESS_MODE_G) {
                bUseDefault = false;
                tmp = (2 * PowerInDbm);
 
@@ -301,7 +301,7 @@ static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
                        TxPwrIdx = 40;
                else
                        TxPwrIdx = (s8)tmp;
-       } else if (WirelessMode == WIRELESS_MODE_B) {
+       } else if (mode == WIRELESS_MODE_B) {
                bUseDefault = false;
                tmp = (4 * PowerInDbm) - 52;
 
index 48eda5564ba50cb92e297f9b9ae891d893068adf..9c8b57f1f3bed95d176327fdf3461833b5882e13 100644 (file)
@@ -872,7 +872,7 @@ static u8 GetSupportedWirelessMode8185(struct net_device *dev)
 
 static void
 ActUpdateChannelAccessSetting(struct net_device *dev,
-                             WIRELESS_MODE WirelessMode,
+                             enum wireless_mode mode,
                              struct chnl_access_setting *chnl_access_setting)
 {
        AC_CODING       eACI;
@@ -959,7 +959,7 @@ static void ActSetWirelessMode8185(struct net_device *dev, u8 btWirelessMode)
         * wireless mode if we switch to specified band successfully.
         */
 
-       ieee->mode = (WIRELESS_MODE)btWirelessMode;
+       ieee->mode = (enum wireless_mode)btWirelessMode;
 
        /* 3. Change related setting. */
        if (ieee->mode == WIRELESS_MODE_A)
@@ -1385,7 +1385,7 @@ void rtl8185b_adapter_start(struct net_device *dev)
 
                /* Initialize RegWirelessMode if it is not a valid one. */
                if (bInvalidWirelessMode)
-                       ieee->mode = (WIRELESS_MODE)InitWirelessMode;
+                       ieee->mode = (enum wireless_mode)InitWirelessMode;
 
        } else {
        /* One of B, G, A. */