staging:rtl8192u: Refactor enum VERSION_819xU - Style
authorJohn Whitmore <johnfwhitmore@gmail.com>
Sun, 26 Aug 2018 21:14:19 +0000 (22:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2018 17:27:47 +0000 (19:27 +0200)
Rename enumerated type VERSION_819xU to version_819xu to clear
checkpatch issue with CamelCase naming. Additionally the constants
defined by the type are renamed for the same reason.

Remove the 'typedef' directive to clear the checkpatch issue with
defining new types.

The enumerated type has been moved to the file where the type is
actually used, r8192U.h

Additionally the memeber variable, which uses the type
(card_8192_version), has been changed to use the type to enable
compiler typechecking.

These are coding style changes which should not impact runtime code
execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8190_rtl8256.c
drivers/staging/rtl8192u/r8192U.h
drivers/staging/rtl8192u/r8192U_core.c
drivers/staging/rtl8192u/r8192U_hw.h
drivers/staging/rtl8192u/r819xU_phy.c

index 9b7f822e976206137394aa43c7ec873c2295eb77..e60da23583433d4d23de3ec368f04477d9ab1e69 100644 (file)
@@ -37,9 +37,9 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, enum ht_channel_width Bandwi
 
                switch (Bandwidth) {
                case HT_CHANNEL_WIDTH_20:
-                               if (priv->card_8192_version == VERSION_819xU_A
+                               if (priv->card_8192_version == VERSION_819XU_A
                                        || priv->card_8192_version
-                                       == VERSION_819xU_B) { /* 8256 D-cut, E-cut, xiong: consider it later! */
+                                       == VERSION_819XU_B) { /* 8256 D-cut, E-cut, xiong: consider it later! */
                                        rtl8192_phy_SetRFReg(dev,
                                                (enum rf90_radio_path_e)eRFPath,
                                                0x0b, bMask12Bits, 0x100); /* phy para:1ba */
@@ -57,7 +57,7 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, enum ht_channel_width Bandwi
                                        }
                                break;
                case HT_CHANNEL_WIDTH_20_40:
-                               if (priv->card_8192_version == VERSION_819xU_A || priv->card_8192_version == VERSION_819xU_B) { /* 8256 D-cut, E-cut, xiong: consider it later! */
+                               if (priv->card_8192_version == VERSION_819XU_A || priv->card_8192_version == VERSION_819XU_B) { /* 8256 D-cut, E-cut, xiong: consider it later! */
                                        rtl8192_phy_SetRFReg(dev, (enum rf90_radio_path_e)eRFPath, 0x0b, bMask12Bits, 0x300); /* phy para:3ba */
                                        rtl8192_phy_SetRFReg(dev, (enum rf90_radio_path_e)eRFPath, 0x2c, bMask12Bits, 0x3df);
                                        rtl8192_phy_SetRFReg(dev, (enum rf90_radio_path_e)eRFPath, 0x0e, bMask12Bits, 0x0a1);
index 94a14899406979a4f1e079c085918147e7c436d9..ce287e2f79e157f076d583bcd93682211160d725 100644 (file)
@@ -798,6 +798,12 @@ typedef enum _tag_TxCmd_Config_Index {
        TXCMD_XXXX_CTRL,
 } DCMD_TXCMD_OP;
 
+enum version_819xu {
+       VERSION_819XU_A, // A-cut
+       VERSION_819XU_B, // B-cut
+       VERSION_819XU_C,// C-cut
+};
+
 typedef struct r8192_priv {
        struct usb_device *udev;
        /* For maintain info from eeprom */
@@ -815,7 +821,7 @@ typedef struct r8192_priv {
        /* O: rtl8192, 1: rtl8185 V B/C, 2: rtl8185 V D */
        short card_8192;
        /* If TCR reports card V B/C, this discriminates */
-       u8 card_8192_version;
+       enum version_819xu card_8192_version;
        short enable_gpio0;
        enum card_type {
                PCI, MINIPCI, CARDBUS, USB
index 4003c6933dc79109d4028f01ec3b8fc63209512c..34863a7cc524d63e2d82488dba0a89c29cd60a17 100644 (file)
@@ -2395,7 +2395,7 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
        } else {
                priv->eeprom_vid = 0;
                priv->eeprom_pid = 0;
-               priv->card_8192_version = VERSION_819xU_B;
+               priv->card_8192_version = VERSION_819XU_B;
                priv->eeprom_ChannelPlan = 0;
                priv->eeprom_CustomerID = 0;
        }
@@ -2422,7 +2422,7 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
        priv->rf_type = RTL819X_DEFAULT_RF_TYPE; /* default 1T2R */
        priv->rf_chip = RF_8256;
 
-       if (priv->card_8192_version == (u8)VERSION_819xU_A) {
+       if (priv->card_8192_version == VERSION_819XU_A) {
                /* read Tx power gain offset of legacy OFDM to HT rate */
                if (bLoad_From_EEPOM) {
                        ret = eprom_read(dev, (EEPROM_TxPowerDiff >> 1));
@@ -2567,7 +2567,7 @@ static int rtl8192_read_eeprom_info(struct net_device *dev)
                 * 92U does not enable TX power tracking.
                 */
                priv->ThermalMeter[0] = priv->EEPROMThermalMeter;
-       } /* end if VersionID == VERSION_819xU_A */
+       } /* end if VersionID == VERSION_819XU_A */
 
        /* for dlink led */
        switch (priv->eeprom_CustomerID) {
@@ -2872,7 +2872,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
 
        rtl8192_phy_configmac(dev);
 
-       if (priv->card_8192_version == (u8)VERSION_819xU_A) {
+       if (priv->card_8192_version == VERSION_819XU_A) {
                rtl8192_phy_getTxPower(dev);
                rtl8192_phy_setTxPower(dev, priv->chan);
        }
index 00a123d44207b54c35a8eaaea4d330c9a1eaba9e..15e56003d97c4ac1e5276d9663cf89cc7bc078ef 100644 (file)
 #ifndef R8192_HW
 #define R8192_HW
 
-typedef enum _VERSION_819xU {
-       VERSION_819xU_A, // A-cut
-       VERSION_819xU_B, // B-cut
-       VERSION_819xU_C,// C-cut
-} VERSION_819xU, *PVERSION_819xU;
 //added for different RF type
 typedef enum _RT_RF_TYPE_DEF {
        RF_1T2R = 0,
index 0a13a1f8a14d6d252807b67c2c1246a3b90d1dbe..e7c3582f550e94e1ca0481deb56e2de0075aec88 100644 (file)
@@ -814,7 +814,7 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev)
 
        /* ----Enable XSTAL ---- */
        write_nic_byte_E(dev, 0x5e, 0x00);
-       if (priv->card_8192_version == (u8)VERSION_819xU_A) {
+       if (priv->card_8192_version == VERSION_819XU_A) {
                /* Antenna gain offset from B/C/D to A */
                reg_u32 = priv->AntennaTxPwDiff[1]<<4 |
                           priv->AntennaTxPwDiff[0];
@@ -1367,7 +1367,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
 
                switch (CurrentCmd->cmd_id) {
                case CMD_ID_SET_TX_PWR_LEVEL:
-                       if (priv->card_8192_version == (u8)VERSION_819xU_A)
+                       if (priv->card_8192_version == VERSION_819XU_A)
                                /* consider it later! */
                                rtl8192_SetTxPowerLevel(dev, channel);
                        break;