mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Whitmore <johnfwhitmore@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	John Whitmore <johnfwhitmore@gmail.com>
Subject: [PATCH 04/21] staging:rtl8192u: Refactor BaseBand_Config_Type - Style
Date: Sun, 26 Aug 2018 22:14:22 +0100	[thread overview]
Message-ID: <20180826211439.14326-5-johnfwhitmore@gmail.com> (raw)
In-Reply-To: <20180826211439.14326-1-johnfwhitmore@gmail.com>

Rename the type to baseband_config_type to clear the checkpatch issue
with CamelCase naming. Remove the 'typedef' directive to clear the
issue with defining new types.

As it is only used in the file r819xU_phy.c the type has been moved
to the r819xU_phy.h file.

The enumerated type is only used as a parameter to the function
rtl8192_phyConfigBB. Previously that parameter used type 'u8' so no
compiler typechecking was being performed. The parameter type has been
corrected.

These changes are coding style changes and as such should have no
impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_hw.h  |  4 ----
 drivers/staging/rtl8192u/r819xU_phy.c | 11 ++++++-----
 drivers/staging/rtl8192u/r819xU_phy.h |  5 +++++
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_hw.h b/drivers/staging/rtl8192u/r8192U_hw.h
index f91dd20fa568..0b5fb42e5427 100644
--- a/drivers/staging/rtl8192u/r8192U_hw.h
+++ b/drivers/staging/rtl8192u/r8192U_hw.h
@@ -20,10 +20,6 @@
 #ifndef R8192_HW
 #define R8192_HW
 
-typedef enum _BaseBand_Config_Type {
-	BaseBand_Config_PHY_REG = 0,			//Radio Path A
-	BaseBand_Config_AGC_TAB = 1,			//Radio Path B
-} BaseBand_Config_Type, *PBaseBand_Config_Type;
 #define	RTL8187_REQT_READ	0xc0
 #define	RTL8187_REQT_WRITE	0x40
 #define	RTL8187_REQ_GET_REGS	0x05
diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c
index a6d7ad1f6d79..ee1e39e887ff 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -511,7 +511,8 @@ void rtl8192_phy_configmac(struct net_device *dev)
  * notice:    BB parameters may change all the time, so please make
  *            sure it has been synced with the newest.
  *****************************************************************************/
-static void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
+static void rtl8192_phyConfigBB(struct net_device *dev,
+				enum baseband_config_type ConfigType)
 {
 	u32 i;
 
@@ -525,7 +526,7 @@ static void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
 		Rtl8190AGCTAB_Array_Table = Rtl819XAGCTAB_ArrayDTM;
 	}
 #endif
-	if (ConfigType == BaseBand_Config_PHY_REG) {
+	if (ConfigType == BASEBAND_CONFIG_PHY_REG) {
 		for (i = 0; i < PHY_REG_1T2RArrayLength; i += 2) {
 			rtl8192_setBBreg(dev, Rtl8192UsbPHY_REG_1T2RArray[i],
 					 bMaskDWord,
@@ -535,7 +536,7 @@ static void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
 				 i, Rtl8192UsbPHY_REG_1T2RArray[i],
 				 Rtl8192UsbPHY_REG_1T2RArray[i+1]);
 		}
-	} else if (ConfigType == BaseBand_Config_AGC_TAB) {
+	} else if (ConfigType == BASEBAND_CONFIG_AGC_TAB) {
 		for (i = 0; i < AGCTAB_ArrayLength; i += 2) {
 			rtl8192_setBBreg(dev, Rtl8192UsbAGCTAB_Array[i],
 					 bMaskDWord, Rtl8192UsbAGCTAB_Array[i+1]);
@@ -802,7 +803,7 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev)
 	rtl8192_setBBreg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0);
 	/* ----BB Register Initilazation---- */
 	/* ==m==>Set PHY REG From Header<==m== */
-	rtl8192_phyConfigBB(dev, BaseBand_Config_PHY_REG);
+	rtl8192_phyConfigBB(dev, BASEBAND_CONFIG_PHY_REG);
 
 	/* ----Set BB reset de-Active---- */
 	read_nic_dword(dev, CPU_GEN, &reg_u32);
@@ -810,7 +811,7 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev)
 
 	/* ----BB AGC table Initialization---- */
 	/* ==m==>Set PHY REG From Header<==m== */
-	rtl8192_phyConfigBB(dev, BaseBand_Config_AGC_TAB);
+	rtl8192_phyConfigBB(dev, BASEBAND_CONFIG_AGC_TAB);
 
 	/* ----Enable XSTAL ---- */
 	write_nic_byte_E(dev, 0x5e, 0x00);
diff --git a/drivers/staging/rtl8192u/r819xU_phy.h b/drivers/staging/rtl8192u/r819xU_phy.h
index c938fd8eb51c..8c2933264407 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.h
+++ b/drivers/staging/rtl8192u/r819xU_phy.h
@@ -7,6 +7,11 @@
 #define MAX_RFDEPENDCMD_CNT 16
 #define MAX_POSTCMD_CNT 16
 
+enum baseband_config_type {
+	BASEBAND_CONFIG_PHY_REG = 0,			//Radio Path A
+	BASEBAND_CONFIG_AGC_TAB = 1,			//Radio Path B
+};
+
 enum switch_chan_cmd_id {
 	CMD_ID_END,
 	CMD_ID_SET_TX_PWR_LEVEL,
-- 
2.18.0


  parent reply	other threads:[~2018-08-26 21:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 21:14 [PATCH 00/21] staging:rtl8192u: r8192U_hw.h " John Whitmore
2018-08-26 21:14 ` [PATCH 01/21] staging:rtl8192u: Refactor enum VERSION_819xU " John Whitmore
2018-08-26 21:14 ` [PATCH 02/21] staging:rtl8192u: Refactor RT_RF_TYPE_DEF " John Whitmore
2018-08-26 21:14 ` [PATCH 03/21] staging:rtl8192u: Make function rtl8192_phyConfigBB static John Whitmore
2018-08-26 21:14 ` John Whitmore [this message]
2018-08-26 21:14 ` [PATCH 05/21] staging:rtl8192u: Remove unused definitions - Style John Whitmore
2018-08-26 21:14 ` [PATCH 06/21] staging:rtl8192u: Reorder enum _RTL8192Usb_HW members " John Whitmore
2018-08-26 21:14 ` [PATCH 07/21] staging:rtl8192u: Rename EEPROM_TxPowerDiff " John Whitmore
2018-08-26 21:14 ` [PATCH 08/21] staging:rtl8192u: Rename EEPROM_ThermalMeter " John Whitmore
2018-08-26 21:14 ` [PATCH 09/21] staging:rtl8192u: Rename EEPROM_PwDiff " John Whitmore
2018-08-26 21:14 ` [PATCH 10/21] staging:rtl8192u: Rename EEPROM_CrystalCap " John Whitmore
2018-08-26 21:14 ` [PATCH 11/21] staging:rtl8192u: Rename EEPROM_TxPwIndex_CCK " John Whitmore
2018-08-26 21:14 ` [PATCH 12/21] staging:rtl8192u: Rename EEPROM_TxPwIndex_OFDM_24G_V1 - STYLE John Whitmore
2018-08-26 21:14 ` [PATCH 13/21] staging:rtl8192u: Rename EEPROM_TxPwIndex_OFDM_24G - Style John Whitmore
2018-08-26 21:14 ` [PATCH 14/21] staging:rtl8192u: Rename EEPROM_TxPwIndex_CCK_V1 " John Whitmore
2018-08-26 21:14 ` [PATCH 15/21] staging:rtl8192u: rename EEPROM_TxPwIndex_Ver " John Whitmore
2018-08-26 21:14 ` [PATCH 16/21] staging:rtl8192u: Rename EEPROM_Default_ThermalMeter " John Whitmore
2018-08-26 21:14 ` [PATCH 17/21] staging:rtl8192u: Rename EEPROM_Default_PwDiff " John Whitmore
2018-08-26 21:14 ` [PATCH 18/21] staging:rtl8192u: Rename EEPROM_Default_CrystalCap " John Whitmore
2018-08-26 21:14 ` [PATCH 19/21] staging:rtl8192u: Rename EEPROM_Default_TxPower " John Whitmore
2018-08-26 21:14 ` [PATCH 20/21] staging:rtl8192u: Rename EEPROM_Customer_ID " John Whitmore
2018-08-26 21:14 ` [PATCH 21/21] staging:rtl8192u: Rename EEPROM_ChannelPlan " John Whitmore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180826211439.14326-5-johnfwhitmore@gmail.com \
    --to=johnfwhitmore@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®