From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 07/11] staging: rtl8192e: Replace union qos_tsinfo with embedded struct
Date: Mon, 23 Oct 2023 08:40:18 +0200 [thread overview]
Message-ID: <3bedc504ad678332e4ab2a3d99f2a94ab5aed03a.1698042685.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1698042685.git.philipp.g.hortmann@gmail.com>
Replace union qos_tsinfo with embedded struct as it has only one element.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl819x_BAProc.c | 2 +-
drivers/staging/rtl8192e/rtl819x_Qos.h | 8 +++-----
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 18 +++++++++---------
4 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index f01fb7131c7e..4af8055d2489 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -474,7 +474,7 @@ void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts,
ba->dialog_token++;
ba->ba_param_set.field.amsdu_support = 0;
ba->ba_param_set.field.ba_policy = policy;
- ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.field.ucTSID;
+ ba->ba_param_set.field.tid = ts->TsCommonInfo.TSpec.ucTSID;
ba->ba_param_set.field.buffer_size = 32;
ba->ba_timeout_value = 0;
ba->ba_start_seq_ctrl.field.seq_num = (ts->TxCurSeq + 3) % 4096;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 73fdf6aaed67..64a1e6aa501b 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -7,11 +7,9 @@
#ifndef __INC_QOS_TYPE_H
#define __INC_QOS_TYPE_H
-union qos_tsinfo {
- struct {
- u8 ucTSID:4;
- u8 ucDirection:2;
- } field;
+struct qos_tsinfo {
+ u8 ucTSID:4;
+ u8 ucDirection:2;
};
struct octet_string {
diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index ed77763bb1fc..b63edb815902 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -20,7 +20,7 @@ enum tr_select {
struct ts_common_info {
struct list_head List;
u8 addr[ETH_ALEN];
- union qos_tsinfo TSpec;
+ struct qos_tsinfo TSpec;
union qos_tclas TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 969418031f5f..fbbe538f0632 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -94,7 +94,7 @@ static void TsAddBaProcess(struct timer_list *t)
static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
- memset(&pTsCommonInfo->TSpec, 0, sizeof(union qos_tsinfo));
+ memset(&pTsCommonInfo->TSpec, 0, sizeof(struct qos_tsinfo));
memset(&pTsCommonInfo->TClass, 0, sizeof(union qos_tclas) * TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
@@ -201,8 +201,8 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
continue;
list_for_each_entry(pRet, psearch_list, List) {
if (memcmp(pRet->addr, addr, 6) == 0 &&
- pRet->TSpec.field.ucTSID == TID &&
- pRet->TSpec.field.ucDirection == dir)
+ pRet->TSpec.ucTSID == TID &&
+ pRet->TSpec.ucDirection == dir)
break;
}
if (&pRet->List != psearch_list)
@@ -215,7 +215,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
}
static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
- union qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
+ struct qos_tsinfo *pTSPEC, union qos_tclas *pTCLAS,
u8 TCLAS_Num, u8 TCLAS_Proc)
{
u8 count;
@@ -227,7 +227,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *addr,
if (pTSPEC)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC,
- sizeof(union qos_tsinfo));
+ sizeof(struct qos_tsinfo));
for (count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->TClass[count])),
@@ -241,8 +241,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{
u8 UP = 0;
- union qos_tsinfo TSpec;
- union qos_tsinfo *ts_info = &TSpec;
+ struct qos_tsinfo TSpec;
+ struct qos_tsinfo *ts_info = &TSpec;
struct list_head *pUnusedList;
struct list_head *pAddmitList;
enum direction_value Dir;
@@ -318,8 +318,8 @@ bool rtllib_get_ts(struct rtllib_device *ieee, struct ts_common_info **ppTS,
netdev_dbg(ieee->dev,
"to init current TS, UP:%d, Dir:%d, addr: %pM ppTs=%p\n",
UP, Dir, addr, *ppTS);
- ts_info->field.ucTSID = UP;
- ts_info->field.ucDirection = Dir;
+ ts_info->ucTSID = UP;
+ ts_info->ucDirection = Dir;
MakeTSEntry(*ppTS, addr, &TSpec, NULL, 0, 0);
list_add_tail(&((*ppTS)->List), pAddmitList);
--
2.42.0
next prev parent reply other threads:[~2023-10-23 6:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 6:39 [PATCH 00/11] staging: rtl8192e: Remove unused variable ucReserved and further Philipp Hortmann
2023-10-23 6:39 ` [PATCH 01/11] staging: rtl8192e: Replace BIT0 to BIT9 with BIT(0) to BIT(9) Philipp Hortmann
2023-10-23 6:39 ` [PATCH 02/11] staging: rtl8192e: Replace BIT10 to BIT31 with BIT(10) to BIT(31) Philipp Hortmann
2023-10-23 6:39 ` [PATCH 03/11] staging: rtl8192e: Remove unused variables ucReserved and friends Philipp Hortmann
2023-10-23 6:39 ` [PATCH 04/11] staging: rtl8192e: Remove written but unevaluated variable ucUP Philipp Hortmann
2023-10-23 6:40 ` [PATCH 05/11] staging: rtl8192e: Remove unused variables from union tspec_body Philipp Hortmann
2023-10-23 6:40 ` [PATCH 06/11] staging: rtl8192e: Replace union tspec_body including embedded struct Philipp Hortmann
2023-10-23 6:40 ` Philipp Hortmann [this message]
2023-10-23 6:40 ` [PATCH 08/11] staging: rtl8192e: Remove unused struct acm Philipp Hortmann
2023-10-23 6:40 ` [PATCH 09/11] staging: rtl8192e: Remove last three parameters of MakeTSEntry() Philipp Hortmann
2023-10-23 6:40 ` [PATCH 10/11] staging: rtl8192e: Remove unused union qos_tclas Philipp Hortmann
2023-10-23 6:40 ` [PATCH 11/11] staging: rtl8192e: Remove unused variables TClasProc and TClasNum Philipp Hortmann
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=3bedc504ad678332e4ab2a3d99f2a94ab5aed03a.1698042685.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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®