Re: [PATCH] Staging: rtl8723bs/core fix brace coding style issues in rtw_recv.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Brother,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Brother-Matthew-De-Angelis/Staging-rtl8723bs-core-fix-brace-coding-style-issues-in-rtw_recv-c/20201205-060156
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 138f3e1265488a9163be7f379073297ba8545cca
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/fca364b8771a74ab2a2dc2079de520f744371298
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Brother-Matthew-De-Angelis/Staging-rtl8723bs-core-fix-brace-coding-style-issues-in-rtw_recv-c/20201205-060156
        git checkout fca364b8771a74ab2a2dc2079de520f744371298
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from drivers/staging/rtl8723bs/include/drv_types.h:25,
                    from drivers/staging/rtl8723bs/core/rtw_recv.c:9:
   drivers/staging/rtl8723bs/include/ieee80211.h:745:1: warning: alignment 1 of 'struct ieee80211_assoc_request_frame' is less than 2 [-Wpacked-not-aligned]
     745 | } __attribute__ ((packed));
         | ^
   drivers/staging/rtl8723bs/include/ieee80211.h:752:1: warning: alignment 1 of 'struct ieee80211_assoc_response_frame' is less than 2 [-Wpacked-not-aligned]
     752 | } __attribute__ ((packed));
         | ^
   drivers/staging/rtl8723bs/core/rtw_recv.c: In function 'ap2sta_data_frame':
>> drivers/staging/rtl8723bs/core/rtw_recv.c:940:4: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     940 |    ;
         |    ^
   drivers/staging/rtl8723bs/core/rtw_recv.c: In function 'rtw_signal_stat_timer_hdl':
   drivers/staging/rtl8723bs/core/rtw_recv.c:2573:6: warning: variable 'num_signal_qual' set but not used [-Wunused-but-set-variable]
    2573 |  u32 num_signal_qual = 0;
         |      ^~~~~~~~~~~~~~~
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:42,
                    from drivers/staging/rtl8723bs/core/rtw_recv.c:9:
   At top level:
   drivers/staging/rtl8723bs/include/rtw_security.h:371:28: warning: 'K' defined but not used [-Wunused-const-variable=]
     371 | static const unsigned long K[64] = {
         |                            ^

vim +/if +940 drivers/staging/rtl8723bs/core/rtw_recv.c

   860	
   861	sint ap2sta_data_frame(struct adapter *adapter, union recv_frame *precv_frame,
   862			       struct sta_info **psta);
   863	sint ap2sta_data_frame(struct adapter *adapter, union recv_frame *precv_frame,
   864			       struct sta_info **psta)
   865	{
   866		u8 *ptr = precv_frame->u.hdr.rx_data;
   867		struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
   868		sint ret = _SUCCESS;
   869		struct sta_priv *pstapriv = &adapter->stapriv;
   870		struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
   871		u8 *mybssid  = get_bssid(pmlmepriv);
   872		u8 *myhwaddr = myid(&adapter->eeprompriv);
   873		sint bmcast = IS_MCAST(pattrib->dst);
   874	
   875		if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) &&
   876		    (check_fwstate(pmlmepriv, _FW_LINKED) == true ||
   877		     check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
   878			) {
   879	
   880			/*  filter packets that SA is myself or multicast or broadcast */
   881			if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
   882				RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA ==myself\n"));
   883				#ifdef DBG_RX_DROP_FRAME
   884				DBG_871X("DBG_RX_DROP_FRAME %s SA =%pM, myhwaddr =%pM\n",
   885					__func__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
   886				#endif
   887				ret = _FAIL;
   888				goto exit;
   889			}
   890	
   891			/*  da should be for me */
   892			if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
   893				RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
   894					(" ap2sta_data_frame:  compare DA fail; DA =%pM\n", MAC_ARG(pattrib->dst)));
   895				#ifdef DBG_RX_DROP_FRAME
   896				DBG_871X("DBG_RX_DROP_FRAME %s DA =%pM\n", __func__, MAC_ARG(pattrib->dst));
   897				#endif
   898				ret = _FAIL;
   899				goto exit;
   900			}
   901	
   902	
   903			/*  check BSSID */
   904			if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
   905			     !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
   906			     (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
   907				RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
   908					(" ap2sta_data_frame:  compare BSSID fail ; BSSID =%pM\n", MAC_ARG(pattrib->bssid)));
   909				RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("mybssid =%pM\n", MAC_ARG(mybssid)));
   910				#ifdef DBG_RX_DROP_FRAME
   911				DBG_871X("DBG_RX_DROP_FRAME %s BSSID =%pM, mybssid =%pM\n",
   912					__func__, MAC_ARG(pattrib->bssid), MAC_ARG(mybssid));
   913				DBG_871X("this adapter = %d, buddy adapter = %d\n", adapter->adapter_type, adapter->pbuddystruct adapter->adapter_type);
   914				#endif
   915	
   916				if (!bmcast) {
   917					DBG_871X("issue_deauth to the nonassociated ap =%pM for the reason(7)\n", MAC_ARG(pattrib->bssid));
   918					issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
   919				}
   920	
   921				ret = _FAIL;
   922				goto exit;
   923			}
   924	
   925			if (bmcast)
   926				*psta = rtw_get_bcmc_stainfo(adapter);
   927			else
   928				*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get ap_info */
   929	
   930			if (!*psta) {
   931				RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ap2sta: can't get psta under STATION_MODE ; drop pkt\n"));
   932				#ifdef DBG_RX_DROP_FRAME
   933				DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under STATION_MODE ; drop pkt\n", __func__);
   934				#endif
   935				ret = _FAIL;
   936				goto exit;
   937			}
   938	
   939			if ((GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE) == WIFI_QOS_DATA_TYPE)
 > 940				;
   941			if (GetFrameSubType(ptr) & BIT(6)) {
   942				/* No data, will not indicate to upper layer, temporily count it here */
   943				count_rx_stats(adapter, precv_frame, *psta);
   944				ret = RTW_RX_HANDLED;
   945				goto exit;
   946			}
   947	
   948		} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
   949			     (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
   950			memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
   951			memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
   952			memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
   953			memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
   954			memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
   955	
   956			/*  */
   957			memcpy(pattrib->bssid,  mybssid, ETH_ALEN);
   958	
   959	
   960			*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get sta_info */
   961			if (!*psta) {
   962				RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under MP_MODE ; drop pkt\n"));
   963				#ifdef DBG_RX_DROP_FRAME
   964				DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under WIFI_MP_STATE ; drop pkt\n", __func__);
   965				#endif
   966				ret = _FAIL;
   967				goto exit;
   968			}
   969	
   970	
   971		} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
   972			/* Special case */
   973			ret = RTW_RX_HANDLED;
   974			goto exit;
   975		} else {
   976			if (!memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && (!bmcast)) {
   977				*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  get sta_info */
   978				if (!*psta) {
   979	
   980					/* for AP multicast issue , modify by yiwei */
   981					static unsigned long send_issue_deauth_time;
   982	
   983					/* DBG_871X("After send deauth , %u ms has elapsed.\n", jiffies_to_msecs(jiffies - send_issue_deauth_time)); */
   984	
   985					if (jiffies_to_msecs(jiffies - send_issue_deauth_time) > 10000 || send_issue_deauth_time == 0) {
   986						send_issue_deauth_time = jiffies;
   987	
   988						DBG_871X("issue_deauth to the ap =%pM for the reason(7)\n", MAC_ARG(pattrib->bssid));
   989	
   990						issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
   991					}
   992				}
   993			}
   994	
   995			ret = _FAIL;
   996			#ifdef DBG_RX_DROP_FRAME
   997			DBG_871X("DBG_RX_DROP_FRAME %s fw_state:0x%x\n", __func__, get_fwstate(pmlmepriv));
   998			#endif
   999		}
  1000	
  1001	exit:
  1002		return ret;
  1003	}
  1004	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux