From: Martin Kaiser Date: Fri, 30 Dec 2022 18:06:37 +0000 (+0100) Subject: staging: r8188eu: clean up qos_option setting X-Git-Tag: v6.6.7~3436^2~168 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d1edfe65d3565aede6724b088cfe34f02f4002a;p=platform%2Fkernel%2Flinux-starfive.git staging: r8188eu: clean up qos_option setting The qos_option variable in function rtw_make_wlanhdr should be a boolean as it's set to true or false. We can directly set it to pqospriv->qos_option instead of using a default value and if statements. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 Link: https://lore.kernel.org/r/20221230180646.91008-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index bb45d59..6671561 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -791,7 +791,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; - u8 qos_option = false; + bool qos_option; __le16 *fctrl = &pwlanhdr->frame_control; struct sta_info *psta; @@ -817,26 +817,20 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); - - if (pqospriv->qos_option) - qos_option = true; + qos_option = pqospriv->qos_option; } 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->addr2, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } 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->addr3, get_bssid(pmlmepriv), ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } else { return _FAIL; }