Re: [PATCH 1/7] staging: r8188eu: use ieee80211 define for version check

From: kernel test robot
Date: Wed Mar 23 2022 - 20:00:51 EST


Hi Martin,

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/Martin-Kaiser/staging-r8188eu-use-ieee80211-helpers-for-parsing/20220323-155119
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 41197a5f11a4b2d11ac19bc62552022153032811
config: sh-randconfig-s031-20220323 (https://download.01.org/0day-ci/archive/20220324/202203240701.1JNFezRj-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/ab583161be478f342c621b22766fc7f233769bef
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Martin-Kaiser/staging-r8188eu-use-ieee80211-helpers-for-parsing/20220323-155119
git checkout ab583161be478f342c621b22766fc7f233769bef
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> drivers/staging/r8188eu/core/rtw_recv.c:1074:14: sparse: sparse: restricted __le16 degrades to integer

vim +1074 drivers/staging/r8188eu/core/rtw_recv.c

1054
1055 static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv_frame)
1056 {
1057 /* shall check frame subtype, to / from ds, da, bssid */
1058
1059 /* then call check if rx seq/frag. duplicated. */
1060
1061 int retval = _FAIL;
1062 u8 bDumpRxPkt;
1063 struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
1064 u8 *ptr = precv_frame->rx_data;
1065 __le16 fc = *(__le16 *)ptr;
1066 struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
1067
1068 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
1069 int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter));
1070 if (ch_set_idx >= 0)
1071 pmlmeext->channel_set[ch_set_idx].rx_count++;
1072 }
1073
> 1074 if ((fc & IEEE80211_FCTL_VERS) != 0)
1075 return _FAIL;
1076
1077 pattrib->to_fr_ds = get_tofr_ds(ptr);
1078
1079 pattrib->frag_num = GetFragNum(ptr);
1080 pattrib->seq_num = GetSequence(ptr);
1081
1082 pattrib->pw_save = GetPwrMgt(ptr);
1083 pattrib->mfrag = ieee80211_has_morefrags(fc);
1084 pattrib->mdata = ieee80211_has_moredata(fc);
1085 pattrib->privacy = ieee80211_has_protected(fc);
1086 pattrib->order = ieee80211_has_order(fc);
1087
1088 /* Dump rx packets */
1089 GetHalDefVar8188EUsb(adapter, HAL_DEF_DBG_DUMP_RXPKT, &bDumpRxPkt);
1090
1091 /* We return _SUCCESS only for data frames. */
1092 if (ieee80211_is_mgmt(fc))
1093 validate_recv_mgnt_frame(adapter, precv_frame);
1094 else if (ieee80211_is_ctl(fc))
1095 validate_recv_ctrl_frame(adapter, precv_frame);
1096 else if (ieee80211_is_data(fc)) {
1097 rtw_led_control(adapter, LED_CTL_RX);
1098 pattrib->qos = ieee80211_is_data_qos(fc);
1099 retval = validate_recv_data_frame(adapter, precv_frame);
1100 if (retval == _FAIL) {
1101 struct recv_priv *precvpriv = &adapter->recvpriv;
1102 precvpriv->rx_drop++;
1103 }
1104 }
1105
1106 return retval;
1107 }
1108

--
0-DAY CI Kernel Test Service
https://01.org/lkp