Skip to contentSkip to conversation

staging: rtl8723bs: struct rename and cast unwind

PATCH Superseded Timo Joannin 2 participants 4 messages Oct 7 – Oct 13 Staging

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover staging: rtl8723bs: struct rename and cast unwind

Hey Now,

This patch series splits the v3 patch into a 2-part series as requested, separating the struct renaming from the cast mess unwinding.

Changes in v4:
- Split monolithic patch into 2-part series.
- Removed dead struct phy_stat and unused prototype rtl8723b_query_rx_phy_status().

Changes in v3:
- Included patch version changelog (missed in v2, sorry).

Changes in v2:
- Propagated the real struct type through
the call chain to remove u8 * casting.

Regarding your question about the existence of struct phy_stat, I discovered it was dead code; no function actually used it. Furthermore, the rtl8723b_query_rx_phy_status() function prototype referencing it was also unused, and was removed.

Patch 1 renames struct phy_status_rpt_8192cd_t
to rtl8723bs_phy_status_rpt.

Patch 2 unwinds the cast mess and propagates the real struct type all the way through
the call chain, and removes the unused phy_stat struct and ghost function prototype.

Please have a look.

Thanks,
Timo Joannin

Timo Joannin (2):
staging: rtl8723bs: rename struct phy_status_rpt_8192cd_t to

    rtl8723bs_phy_status_rpt.

staging: rtl8723bs: unwind cast mess and remove phy_stat struct

 drivers/staging/rtl8723bs/hal/odm_HWConfig.c   |  6 +++---
 drivers/staging/rtl8723bs/hal/odm_HWConfig.h   |  5 +++--
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c |  7 ++++---
 .../staging/rtl8723bs/include/rtl8192c_recv.h  | 18 ------------------
 .../staging/rtl8723bs/include/rtl8723b_recv.h  |  1 -
 5 files changed, 10 insertions(+), 27 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH v4 1/2 staging: rtl8723bs: rename struct phy_status_rpt_8192cd_t to rtl8723bs_phy_status_rpt.

The struct identifier references the 8192CD chip while being in a rtl8723bs codebase. Additionally, the identifier uses the _t suffix, while being generally reserved for typedef identifiers.

Rename the struct to rtl8723bs_phy_status_rpt
across the rtl8723bs codebase to accurately
reflect the driver and clean up the naming.

---
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 3 ++-
 drivers/staging/rtl8723bs/hal/odm_HWConfig.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +2 -1
index 34b0369a7936..bf2479c01873 100644
@@ -105,7 +105,8 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
 	bool is_cck_rate = false;
 	u8 rf_rx_num = 0;
 	u8 lna_idx, vga_idx;
-	struct phy_status_rpt_8192cd_t *phy_sta_rpt = (struct phy_status_rpt_8192cd_t *)phy_status;
+	struct rtl8723bs_phy_status_rpt *phy_sta_rpt =
+		(struct rtl8723bs_phy_status_rpt *)phy_status;
 
 	is_cck_rate = pkt_info->data_rate <= DESC_RATE11M;
 	phy_info->rx_mimo_signal_quality[RF_PATH_A] = -1;
drivers/staging/rtl8723bs/hal/odm_HWConfig.h +1 -1
index ca3380328a72..ae010cae9dd7 100644
@@ -18,7 +18,7 @@ struct phy_rx_agc_info_t {
 	#endif
 };
 
-struct phy_status_rpt_8192cd_t {
+struct rtl8723bs_phy_status_rpt {
 	struct phy_rx_agc_info_t path_agc[2];
 	u8 ch_corr[2];
 	u8 cck_sig_qual_ofdm_pwdb_all;
Signature · 1 line
2.55.0
#2 lore raw

PATCH v4 2/2 staging: rtl8723bs: unwind cast mess and remove phy_stat struct

In reply to Timo Joannin

Propagate the real struct type all the way through the call chain to remove redundant casts to and from u8 *.

Remove redundant phy_stat struct, along with the dead function prototype rtl8723b_query_rx_phy_status() which referenced it.

---
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c   |  7 +++----
 drivers/staging/rtl8723bs/hal/odm_HWConfig.h   |  3 ++-
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c |  7 ++++---
 .../staging/rtl8723bs/include/rtl8192c_recv.h  | 18 ------------------
 .../staging/rtl8723bs/include/rtl8723b_recv.h  |  1 -
 5 files changed, 9 insertions(+), 27 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +3 -4
index bf2479c01873..c85194c8fe67 100644
@@ -95,7 +95,7 @@ static s8 odm_cck_rssi(u8 lna_idx, u8 vga_idx)
 
 static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
 				      struct odm_phy_info *phy_info,
-				      u8 *phy_status,
+				      struct rtl8723bs_phy_status_rpt *phy_sta_rpt,
 				      struct odm_packet_info *pkt_info)
 {
 	u8 i;
@@ -105,8 +105,6 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
 	bool is_cck_rate = false;
 	u8 rf_rx_num = 0;
 	u8 lna_idx, vga_idx;
-	struct rtl8723bs_phy_status_rpt *phy_sta_rpt =
-		(struct rtl8723bs_phy_status_rpt *)phy_status;
 
 	is_cck_rate = pkt_info->data_rate <= DESC_RATE11M;
 	phy_info->rx_mimo_signal_quality[RF_PATH_A] = -1;
@@ -384,7 +382,8 @@ static void odm_Process_RSSIForDM(
 
 /*  Endianness before calling this API */
 void odm_phy_status_query(struct dm_odm_t *dm_odm, struct odm_phy_info *phy_info,
-			  u8 *phy_status, struct odm_packet_info *pkt_info)
+			  struct rtl8723bs_phy_status_rpt *phy_status,
+			  struct odm_packet_info *pkt_info)
 {
 
 	odm_rx_phy_status_parsing(dm_odm, phy_info, phy_status, pkt_info);
drivers/staging/rtl8723bs/hal/odm_HWConfig.h +2 -1
index ae010cae9dd7..21182a880da3 100644
@@ -57,7 +57,8 @@ struct rtl8723bs_phy_status_rpt {
 };
 
 void odm_phy_status_query(struct dm_odm_t *dm_odm, struct odm_phy_info *phy_info,
-			  u8 *phy_status, struct odm_packet_info *pkt_info);
+			  struct rtl8723bs_phy_status_rpt *phy_status,
+			  struct odm_packet_info *pkt_info);
 
 enum hal_status ODM_ConfigRFWithTxPwrTrackHeaderFile(struct dm_odm_t *pDM_Odm);
 
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +4 -3
index 304fda3a3b5c..a62b845c69f9 100644
@@ -73,7 +73,7 @@ static void update_recvframe_attrib(struct adapter *padapter,
  *precvframe->u.hdr.rx_data should be ready!
  */
 static void update_recvframe_phyinfo(union recv_frame *precvframe,
-				     struct phy_stat *pphy_status)
+				     struct rtl8723bs_phy_status_rpt *pphy_status)
 {
 	struct adapter *padapter = precvframe->u.hdr.adapter;
 	struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
@@ -125,7 +125,7 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	pkt_info.data_rate = pattrib->data_rate;
 
 	odm_phy_status_query(&p_hal_data->odmpriv, p_phy_info,
-			   (u8 *)pphy_status, &(pkt_info));
+			   pphy_status, &(pkt_info));
 	if (psta)
 		psta->rssi = pattrib->phy_info.RecvSignalPower;
 	precvframe->u.hdr.psta = NULL;
@@ -317,7 +317,8 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
 
 				if (pattrib->pkt_rpt_type == NORMAL_RX) { /* Normal rx packet */
 					if (pattrib->physt)
-						update_recvframe_phyinfo(precvframe, (struct phy_stat *)ptr);
+						update_recvframe_phyinfo(precvframe,
+							(struct rtl8723bs_phy_status_rpt *)ptr);
 
 					rtw_recv_entry(precvframe);
 				} else if (pattrib->pkt_rpt_type == C2H_PACKET) {
drivers/staging/rtl8723bs/include/rtl8192c_recv.h +0 -18
index b63625ab4e45..072e2b5f6129 100644
@@ -9,24 +9,6 @@
 
 #define MAX_RECVBUF_SZ (10240)
 
-struct phy_stat {
-	unsigned int phydw0;
-
-	unsigned int phydw1;
-
-	unsigned int phydw2;
-
-	unsigned int phydw3;
-
-	unsigned int phydw4;
-
-	unsigned int phydw5;
-
-	unsigned int phydw6;
-
-	unsigned int phydw7;
-};
-
 /*  Rx smooth factor */
 #define	Rx_Smooth_Factor (20)
 
drivers/staging/rtl8723bs/include/rtl8723b_recv.h +0 -1
index e9ebecb224a6..2f230e2d27a4 100644
@@ -84,7 +84,6 @@ struct rxreport_8723b {
 s32 rtl8723bs_init_recv_priv(struct adapter *padapter);
 void rtl8723bs_free_recv_priv(struct adapter *padapter);
 
-void rtl8723b_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat);
 void rtl8723b_process_phy_info(struct adapter *padapter, void *prframe);
 
 void rtl8723b_read_chip_version(struct adapter *padapter);
Signature · 1 line
2.55.0
#3 lore raw
In reply to Timo Joannin
Quoted 9 lines · Timo Joannin

Hey Now,

This patch series splits the v3 patch into a 2-part series as requested, separating the struct renaming from the cast mess unwinding.

Changes in v4:
- Split monolithic patch into 2-part series.
- Removed dead struct phy_stat and unused prototype rtl8723b_query_rx_phy_status().

Does not apply, can you please rebase it against staging-testing?

thanks,

greg k-h