2022-11-05 10:06:38

by Jacob Bai

[permalink] [raw]
Subject: [PATCH 0/3] staging: rtl8192e: trivial code cleanup patches

Rename few variables and source files to make it align with other
rtlwifi drivers.
The patches are required to be applied in sequence

Jacob Bai (3):
staging: rtl8192e: rename tables in r8192e_hwimg.c
staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h
staging: rtl8192e: remove unnecesscary macro define

drivers/staging/rtl8192e/rtl8192e/Makefile | 2 +-
.../staging/rtl8192e/rtl8192e/r8192E_hwimg.h | 33 ------------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 54 +++++++++----------
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 20 -------
.../rtl8192e/{r8192E_hwimg.c => table.c} | 20 +++----
drivers/staging/rtl8192e/rtl8192e/table.h | 33 ++++++++++++
6 files changed, 71 insertions(+), 91 deletions(-)
delete mode 100644 drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} (95%)
create mode 100644 drivers/staging/rtl8192e/rtl8192e/table.h

--
2.34.1



2022-11-05 10:17:11

by Jacob Bai

[permalink] [raw]
Subject: [PATCH 1/3] staging: rtl8192e: rename tables in r8192e_hwimg.c

fix camel case issue.

Signed-off-by: Jacob Bai <[email protected]>
---
.../staging/rtl8192e/rtl8192e/r8192E_hwimg.c | 18 +++++-----
.../staging/rtl8192e/rtl8192e/r8192E_hwimg.h | 36 +++++++++----------
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 36 +++++++++----------
3 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
index e6fce749e65b..8920283f340e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
@@ -6,9 +6,9 @@
*/
#include "r8192E_hwimg.h"

-u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE] = {0x0,};
+u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN] = {0x0,};

-u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE] = {
+u32 RTL8192E_PHY_REG_1T2R_ARRAY[RTL8192E_PHY_REG_1T2R_ARRAY_LEN] = {
0x800, 0x00000000,
0x804, 0x00000001,
0x808, 0x0000fc00,
@@ -159,7 +159,7 @@ u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE] = {
0xe1c, 0x12121416,
};

-u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE] = {
+u32 RTL8192E_RADIOA_ARRAY[RTL8192E_RADIOA_ARRAY_LEN] = {
0x019, 0x00000003,
0x000, 0x000000bf,
0x001, 0x00000ee0,
@@ -285,7 +285,7 @@ u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE] = {
0x007, 0x00000700,
};

-u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
+u32 RTL8192E_RADIOB_ARRAY[RTL8192E_RADIOB_ARRAY_LEN] = {
0x019, 0x00000003,
0x000, 0x000000bf,
0x001, 0x000006e0,
@@ -327,13 +327,13 @@ u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
0x007, 0x00000700,
};

-u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE] = {
+u32 RTL8192E_RADIOC_ARRAY[RTL8192E_RADIOC_ARRAY_LEN] = {
0x0, };

-u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE] = {
+u32 RTL8192E_RADIOD_ARRAY[RTL8192E_RADIOD_ARRAY_LEN] = {
0x0, };

-u32 Rtl8192PciEMACPHY_Array[] = {
+u32 RTL8192E_MAC_ARRAY[RTL8192E_MAC_ARRAY_LEN] = {
0x03c, 0xffff0000, 0x00000f0f,
0x340, 0xffffffff, 0x161a1a1a,
0x344, 0xffffffff, 0x12121416,
@@ -342,7 +342,7 @@ u32 Rtl8192PciEMACPHY_Array[] = {
0x318, 0x00000fff, 0x00000100,
};

-u32 Rtl8192PciEMACPHY_Array_PG[] = {
+u32 RTL8192E_MAC_ARRAY_PG[RTL8192E_MAC_ARRAY_PG_LEN] = {
0x03c, 0xffff0000, 0x00000f0f,
0xe00, 0xffffffff, 0x06090909,
0xe04, 0xffffffff, 0x00030306,
@@ -355,7 +355,7 @@ u32 Rtl8192PciEMACPHY_Array_PG[] = {
0x318, 0x00000fff, 0x00000800,
};

-u32 Rtl8192PciEAGCTAB_Array[AGCTAB_ArrayLengthPciE] = {
+u32 RTL8192E_AGC_TAB_ARRAY[RTL8192E_AGC_TAB_ARRAY_LEN] = {
0xc78, 0x7d000001,
0xc78, 0x7d010001,
0xc78, 0x7d020001,
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
index 7d63f5a5c1b7..a436c089a779 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
@@ -11,23 +11,23 @@

#include <linux/types.h>

-#define PHY_REGArrayLengthPciE 1
-extern u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE];
-#define PHY_REG_1T2RArrayLengthPciE 296
-extern u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE];
-#define RadioA_ArrayLengthPciE 246
-extern u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE];
-#define RadioB_ArrayLengthPciE 78
-extern u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE];
-#define RadioC_ArrayLengthPciE 2
-extern u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE];
-#define RadioD_ArrayLengthPciE 2
-extern u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE];
-#define MACPHY_ArrayLengthPciE 18
-extern u32 Rtl8192PciEMACPHY_Array[MACPHY_ArrayLengthPciE];
-#define MACPHY_Array_PGLengthPciE 30
-extern u32 Rtl8192PciEMACPHY_Array_PG[MACPHY_Array_PGLengthPciE];
-#define AGCTAB_ArrayLengthPciE 384
-extern u32 Rtl8192PciEAGCTAB_Array[AGCTAB_ArrayLengthPciE];
+#define RTL8192E_PHY_REG_ARRAY_LEN 1
+extern u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN];
+#define RTL8192E_PHY_REG_1T2R_ARRAY_LEN 296
+extern u32 RTL8192E_PHY_REG_1T2R_ARRAY[RTL8192E_PHY_REG_1T2R_ARRAY_LEN];
+#define RTL8192E_RADIOA_ARRAY_LEN 246
+extern u32 RTL8192E_RADIOA_ARRAY[RTL8192E_RADIOA_ARRAY_LEN];
+#define RTL8192E_RADIOB_ARRAY_LEN 78
+extern u32 RTL8192E_RADIOB_ARRAY[RTL8192E_RADIOB_ARRAY_LEN];
+#define RTL8192E_RADIOC_ARRAY_LEN 2
+extern u32 RTL8192E_RADIOC_ARRAY[RTL8192E_RADIOC_ARRAY_LEN];
+#define RTL8192E_RADIOD_ARRAY_LEN 2
+extern u32 RTL8192E_RADIOD_ARRAY[RTL8192E_RADIOD_ARRAY_LEN];
+#define RTL8192E_MAC_ARRAY_LEN 18
+extern u32 RTL8192E_MAC_ARRAY[RTL8192E_MAC_ARRAY_LEN];
+#define RTL8192E_MAC_ARRAY_PG_LEN 30
+extern u32 RTL8192E_MAC_ARRAY_PG[RTL8192E_MAC_ARRAY_PG_LEN];
+#define RTL8192E_AGC_TAB_ARRAY_LEN 384
+extern u32 RTL8192E_AGC_TAB_ARRAY[RTL8192E_AGC_TAB_ARRAY_LEN];

#endif
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 75629f5df954..e1c1f19b71a3 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -9,25 +9,25 @@

#define MAX_DOZE_WAITING_TIMES_9x 64

-#define AGCTAB_ArrayLength AGCTAB_ArrayLengthPciE
-#define MACPHY_ArrayLength MACPHY_ArrayLengthPciE
-#define RadioA_ArrayLength RadioA_ArrayLengthPciE
-#define RadioB_ArrayLength RadioB_ArrayLengthPciE
-#define MACPHY_Array_PGLength MACPHY_Array_PGLengthPciE
-#define RadioC_ArrayLength RadioC_ArrayLengthPciE
-#define RadioD_ArrayLength RadioD_ArrayLengthPciE
-#define PHY_REGArrayLength PHY_REGArrayLengthPciE
-#define PHY_REG_1T2RArrayLength PHY_REG_1T2RArrayLengthPciE
+#define AGCTAB_ArrayLength RTL8192E_AGC_TAB_ARRAY_LEN
+#define MACPHY_ArrayLength RTL8192E_MAC_ARRAY_LEN
+#define RadioA_ArrayLength RTL8192E_RADIOA_ARRAY_LEN
+#define RadioB_ArrayLength RTL8192E_RADIOB_ARRAY_LEN
+#define MACPHY_Array_PGLength RTL8192E_MAC_ARRAY_PG_LEN
+#define RadioC_ArrayLength RTL8192E_RADIOC_ARRAY_LEN
+#define RadioD_ArrayLength RTL8192E_RADIOD_ARRAY_LEN
+#define PHY_REGArrayLength RTL8192E_PHY_REG_ARRAY_LEN
+#define PHY_REG_1T2RArrayLength RTL8192E_PHY_REG_1T2R_ARRAY_LEN

-#define Rtl819XMACPHY_Array_PG Rtl8192PciEMACPHY_Array_PG
-#define Rtl819XMACPHY_Array Rtl8192PciEMACPHY_Array
-#define Rtl819XRadioA_Array Rtl8192PciERadioA_Array
-#define Rtl819XRadioB_Array Rtl8192PciERadioB_Array
-#define Rtl819XRadioC_Array Rtl8192PciERadioC_Array
-#define Rtl819XRadioD_Array Rtl8192PciERadioD_Array
-#define Rtl819XAGCTAB_Array Rtl8192PciEAGCTAB_Array
-#define Rtl819XPHY_REGArray Rtl8192PciEPHY_REGArray
-#define Rtl819XPHY_REG_1T2RArray Rtl8192PciEPHY_REG_1T2RArray
+#define Rtl819XMACPHY_Array_PG RTL8192E_MAC_ARRAY_PG
+#define Rtl819XMACPHY_Array RTL8192E_MAC_ARRAY
+#define Rtl819XRadioA_Array RTL8192E_RADIOA_ARRAY
+#define Rtl819XRadioB_Array RTL8192E_RADIOB_ARRAY
+#define Rtl819XRadioC_Array RTL8192E_RADIOC_ARRAY
+#define Rtl819XRadioD_Array RTL8192E_RADIOD_ARRAY
+#define Rtl819XAGCTAB_Array RTL8192E_AGC_TAB_ARRAY
+#define Rtl819XPHY_REGArray RTL8192E_PHY_REG_ARRAY
+#define Rtl819XPHY_REG_1T2RArray RTL8192E_PHY_REG_1T2R_ARRAY

extern u32 rtl819XAGCTAB_Array[];

--
2.34.1


2022-11-05 10:22:30

by Jacob Bai

[permalink] [raw]
Subject: [PATCH 2/3] staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h

Same as other rtlwifi frivers, use table.c/h.

Signed-off-by: Jacob Bai <[email protected]>
---
drivers/staging/rtl8192e/rtl8192e/Makefile | 2 +-
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} | 2 +-
drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.h => table.h} | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.c => table.c} (99%)
rename drivers/staging/rtl8192e/rtl8192e/{r8192E_hwimg.h => table.h} (94%)

diff --git a/drivers/staging/rtl8192e/rtl8192e/Makefile b/drivers/staging/rtl8192e/rtl8192e/Makefile
index 75e6ec510555..334d92efd4ba 100644
--- a/drivers/staging/rtl8192e/rtl8192e/Makefile
+++ b/drivers/staging/rtl8192e/rtl8192e/Makefile
@@ -4,7 +4,7 @@ r8192e_pci-objs := \
r8192E_phy.o \
r8192E_firmware.o \
r8192E_cmdpkt.o \
- r8192E_hwimg.o \
+ table.o \
r8190P_rtl8256.o \
rtl_cam.o \
rtl_core.o \
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 58da2dab55bd..eabb4187d907 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -12,7 +12,7 @@
#include "r8192E_phy.h"
#include "rtl_dm.h"

-#include "r8192E_hwimg.h"
+#include "table.h"

static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
0,
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c b/drivers/staging/rtl8192e/rtl8192e/table.c
similarity index 99%
rename from drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
rename to drivers/staging/rtl8192e/rtl8192e/table.c
index 8920283f340e..2e75f40db874 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
+++ b/drivers/staging/rtl8192e/rtl8192e/table.c
@@ -4,7 +4,7 @@
*
* Contact Information: wlanfae <[email protected]>
*/
-#include "r8192E_hwimg.h"
+#include "table.h"

u32 RTL8192E_PHY_REG_ARRAY[RTL8192E_PHY_REG_ARRAY_LEN] = {0x0,};

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h b/drivers/staging/rtl8192e/rtl8192e/table.h
similarity index 94%
rename from drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
rename to drivers/staging/rtl8192e/rtl8192e/table.h
index a436c089a779..a80176c47127 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.h
+++ b/drivers/staging/rtl8192e/rtl8192e/table.h
@@ -4,8 +4,8 @@
*
* Contact Information: wlanfae <[email protected]>
*/
-#ifndef __INC_HAL8192PciE_FW_IMG_H
-#define __INC_HAL8192PciE_FW_IMG_H
+#ifndef __RTL8192E_TABLE__H_
+#define __RTL8192E_TABLE__H_

/*Created on 2008/11/18, 3: 7*/

--
2.34.1


2022-11-05 12:28:16

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/3] staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h

Hi Jacob,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url: https://github.com/intel-lab-lkp/linux/commits/Jacob-Bai/staging-rtl8192e-trivial-code-cleanup-patches/20221105-180428
patch link: https://lore.kernel.org/r/b3f6522959e665f4194764caed30050d7b728b29.1667641211.git.jacob.bai.au%40gmail.com
patch subject: [PATCH 2/3] staging: rtl8192e: rename r8192E_hwimg.c/h to table.c/h
config: x86_64-allyesconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/7b00b7dc3c79fff73bda0f623d6677e4fb6cdf3c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jacob-Bai/staging-rtl8192e-trivial-code-cleanup-patches/20221105-180428
git checkout 7b00b7dc3c79fff73bda0f623d6677e4fb6cdf3c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/staging/rtl8192e/rtl8192e/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c:9:10: fatal error: r8192E_hwimg.h: No such file or directory
9 | #include "r8192E_hwimg.h"
| ^~~~~~~~~~~~~~~~
compilation terminated.


vim +9 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c

94a799425eee82 drivers/staging/rtl8192e/r8192E_firmware.c Larry Finger 2011-08-23 @9 #include "r8192E_hwimg.h"
94a799425eee82 drivers/staging/rtl8192e/r8192E_firmware.c Larry Finger 2011-08-23 10 #include "r8192E_firmware.h"
15d140664c94f5 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c Mateusz Kulikowski 2015-10-19 11 #include "r8192E_cmdpkt.h"
94a799425eee82 drivers/staging/rtl8192e/r8192E_firmware.c Larry Finger 2011-08-23 12 #include <linux/firmware.h>
94a799425eee82 drivers/staging/rtl8192e/r8192E_firmware.c Larry Finger 2011-08-23 13

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (2.17 kB)
config (297.60 kB)
Download all attachments