diff options
author | Aiman Najjar <aiman.najjar@hurranet.com> | 2020-03-29 14:57:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-13 08:55:29 +0200 |
commit | f476c5901fc5b6c1e7ff85975593eae3616bdd1c (patch) | |
tree | 82a7776888decb338e0194f1b74a71a9e94a0bb7 /drivers/staging | |
parent | 45afa5637b85d73cf5eabb1500fe57f55ed70e1f (diff) |
staging: rtl8712: fix checkpatch warnings
This patch fixes multiline dereference warnings in
rtl871x_xmit.c:
WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrptxmickey'
379: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:379:
+ psecuritypriv->
+ XGrptxmickey[psecuritypriv->
WARNING: Avoid multiple line dereference - prefer 'psecuritypriv->XGrpKeyid'
380: FILE: drivers/staging//rtl8712/rtl871x_xmit.c:380:
+ XGrptxmickey[psecuritypriv->
+ XGrpKeyid].skey);
Signed-off-by: Aiman Najjar <aiman.najjar@hurranet.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/ddd296c34c5b0206dfe5cf2e6cbe40e0a118c257.1585508171.git.aiman.najjar@hurranet.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_xmit.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c index 454c26f83406..0f789c821552 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.c +++ b/drivers/staging/rtl8712/rtl871x_xmit.c @@ -351,7 +351,7 @@ static int xmitframe_addmic(struct _adapter *padapter, struct sta_info *stainfo; struct qos_priv *pqospriv = &(padapter->mlmepriv.qospriv); struct pkt_attrib *pattrib = &pxmitframe->attrib; - struct security_priv *psecuritypriv = &padapter->securitypriv; + struct security_priv *psecpriv = &padapter->securitypriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; u8 priority[4] = {0x0, 0x0, 0x0, 0x0}; bool bmcst = is_multicast_ether_addr(pattrib->ra); @@ -369,15 +369,14 @@ static int xmitframe_addmic(struct _adapter *padapter, 0x0, 0x0}; pframe = pxmitframe->buf_addr + TXDESC_OFFSET; if (bmcst) { - if (!memcmp(psecuritypriv->XGrptxmickey - [psecuritypriv->XGrpKeyid].skey, + if (!memcmp(psecpriv->XGrptxmickey + [psecpriv->XGrpKeyid].skey, null_key, 16)) return -ENOMEM; /*start to calculate the mic code*/ r8712_secmicsetkey(&micdata, - psecuritypriv-> - XGrptxmickey[psecuritypriv-> - XGrpKeyid].skey); + psecpriv->XGrptxmickey + [psecpriv->XGrpKeyid].skey); } else { if (!memcmp(&stainfo->tkiptxmickey.skey[0], null_key, 16)) @@ -417,7 +416,7 @@ static int xmitframe_addmic(struct _adapter *padapter, length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - - ((psecuritypriv->sw_encrypt) + ((psecpriv->sw_encrypt) ? pattrib->icv_len : 0); r8712_secmicappend(&micdata, payload, length); @@ -425,7 +424,7 @@ static int xmitframe_addmic(struct _adapter *padapter, } else { length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - - ((psecuritypriv->sw_encrypt) ? + ((psecpriv->sw_encrypt) ? pattrib->icv_len : 0); r8712_secmicappend(&micdata, payload, length); |