[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <beb6c8c826cdda751f29f985f2b5dedfd2f87914.1585353747.git.aiman.najjar@hurranet.com>
Date: Fri, 27 Mar 2020 20:08:10 -0400
From: aimannajjar <aiman.najjar@...ranet.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: aimannajjar <aiman.najjar@...ranet.com>,
Larry Finger <Larry.Finger@...inger.net>,
Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 4/5] staging: rtl8712: fix multiline derefernce warning
This patch fixes the following checkpatch warning in
rtl8712x_xmit.c:
WARNING: Avoid multiple line dereference - prefer 'psta->sta_xmitpriv.txseq_tid[pattrib->priority]'
544: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:544:
+ pattrib->seqnum = psta->sta_xmitpriv.
+ txseq_tid[pattrib->priority];
Signed-off-by: aimannajjar <aiman.najjar@...ranet.com>
---
drivers/staging/rtl8712/rtl871x_xmit.c | 50 +++++++++++++-------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
index 0f789c821552..04da7b318340 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -469,7 +469,7 @@ static sint xmitframe_swencrypt(struct _adapter *padapter,
}
static int make_wlanhdr(struct _adapter *padapter, u8 *hdr,
- struct pkt_attrib *pattrib)
+ struct pkt_attrib *pattr)
{
u16 *qc;
@@ -479,70 +479,70 @@ static int make_wlanhdr(struct _adapter *padapter, u8 *hdr,
__le16 *fctrl = &pwlanhdr->frame_ctl;
memset(hdr, 0, WLANHDR_OFFSET);
- SetFrameSubType(fctrl, pattrib->subtype);
- if (pattrib->subtype & WIFI_DATA_TYPE) {
+ SetFrameSubType(fctrl, pattr->subtype);
+ if (pattr->subtype & WIFI_DATA_TYPE) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* to_ds = 1, fr_ds = 0; */
SetToDs(fctrl);
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv),
ETH_ALEN);
- memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
- memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
+ memcpy(pwlanhdr->addr2, pattr->src, ETH_ALEN);
+ memcpy(pwlanhdr->addr3, pattr->dst, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* to_ds = 0, fr_ds = 1; */
SetFrDs(fctrl);
- memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
+ memcpy(pwlanhdr->addr1, pattr->dst, ETH_ALEN);
memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv),
ETH_ALEN);
- memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
+ memcpy(pwlanhdr->addr3, pattr->src, ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
check_fwstate(pmlmepriv,
WIFI_ADHOC_MASTER_STATE)) {
- memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
- memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
+ memcpy(pwlanhdr->addr1, pattr->dst, ETH_ALEN);
+ memcpy(pwlanhdr->addr2, pattr->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
ETH_ALEN);
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
- memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
- memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
+ memcpy(pwlanhdr->addr1, pattr->dst, ETH_ALEN);
+ memcpy(pwlanhdr->addr2, pattr->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv),
ETH_ALEN);
} else {
return -EINVAL;
}
- if (pattrib->encrypt)
+ if (pattr->encrypt)
SetPrivacy(fctrl);
if (pqospriv->qos_option) {
- qc = (unsigned short *)(hdr + pattrib->hdrlen - 2);
- if (pattrib->priority)
- SetPriority(qc, pattrib->priority);
- SetAckpolicy(qc, pattrib->ack_policy);
+ qc = (unsigned short *)(hdr + pattr->hdrlen - 2);
+ if (pattr->priority)
+ SetPriority(qc, pattr->priority);
+ SetAckpolicy(qc, pattr->ack_policy);
}
/* TODO: fill HT Control Field */
/* Update Seq Num will be handled by f/w */
{
struct sta_info *psta;
- bool bmcst = is_multicast_ether_addr(pattrib->ra);
+ bool bmcst = is_multicast_ether_addr(pattr->ra);
- if (pattrib->psta) {
- psta = pattrib->psta;
+ if (pattr->psta) {
+ psta = pattr->psta;
} else {
if (bmcst)
psta = r8712_get_bcmc_stainfo(padapter);
else
psta =
r8712_get_stainfo(&padapter->stapriv,
- pattrib->ra);
+ pattr->ra);
}
if (psta) {
psta->sta_xmitpriv.txseq_tid
- [pattrib->priority]++;
- psta->sta_xmitpriv.txseq_tid[pattrib->priority]
+ [pattr->priority]++;
+ psta->sta_xmitpriv.txseq_tid[pattr->priority]
&= 0xFFF;
- pattrib->seqnum = psta->sta_xmitpriv.
- txseq_tid[pattrib->priority];
- SetSeqNum(hdr, pattrib->seqnum);
+ pattr->seqnum =
+ psta->sta_xmitpriv.txseq_tid[pattr->priority];
+ SetSeqNum(hdr, pattr->seqnum);
}
}
}
--
2.20.1
Powered by blists - more mailing lists