public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Subject: Re: [PATCH] staging: rtl8188eu: Replace a custom function with crc32_le()
Date: Sat, 10 Jul 2021 08:25:12 +0800	[thread overview]
Message-ID: <202107100829.RxcC1tei-lkp@intel.com> (raw)
In-Reply-To: <20210701133809.26534-1-fmdefrancesco@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5721 bytes --]

Hi "Fabio,

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/Fabio-M-De-Francesco/staging-rtl8188eu-Replace-a-custom-function-with-crc32_le/20210701-213922
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 77ad1f0e99bd00af024e650b862cfda3137af660
config: powerpc64-randconfig-s032-20210709 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.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.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/c296b1e11db85710adc1831c4cdb2295192e447f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Fabio-M-De-Francesco/staging-rtl8188eu-Replace-a-custom-function-with-crc32_le/20210701-213922
        git checkout c296b1e11db85710adc1831c4cdb2295192e447f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 

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


sparse warnings: (new ones prefixed by >>)
>> drivers/staging/rtl8188eu/core/rtw_security.c:597:58: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] @@     got unsigned int @@
   drivers/staging/rtl8188eu/core/rtw_security.c:597:58: sparse:     expected restricted __le32 [usertype]
   drivers/staging/rtl8188eu/core/rtw_security.c:597:58: sparse:     got unsigned int
   drivers/staging/rtl8188eu/core/rtw_security.c:604:58: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] @@     got unsigned int @@
   drivers/staging/rtl8188eu/core/rtw_security.c:604:58: sparse:     expected restricted __le32 [usertype]
   drivers/staging/rtl8188eu/core/rtw_security.c:604:58: sparse:     got unsigned int
   drivers/staging/rtl8188eu/core/rtw_security.c:671:42: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] @@     got unsigned int @@
   drivers/staging/rtl8188eu/core/rtw_security.c:671:42: sparse:     expected restricted __le32 [usertype]
   drivers/staging/rtl8188eu/core/rtw_security.c:671:42: sparse:     got unsigned int

vim +597 drivers/staging/rtl8188eu/core/rtw_security.c

   544	
   545	/* The hlen isn't include the IV */
   546	u32	rtw_tkip_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
   547	{																	/*  exclude ICV */
   548		u16	pnl;
   549		u32	pnh;
   550		u8	rc4key[16];
   551		u8   ttkey[16];
   552		u8	crc[4];
   553		u8   hw_hdr_offset = 0;
   554		struct arc4context mycontext;
   555		int			curfragnum, length;
   556	
   557		u8	*pframe, *payload, *iv, *prwskey;
   558		union pn48 dot11txpn;
   559		struct	sta_info		*stainfo;
   560		struct	pkt_attrib	 *pattrib = &pxmitframe->attrib;
   561		struct	security_priv	*psecuritypriv = &padapter->securitypriv;
   562		struct	xmit_priv		*pxmitpriv = &padapter->xmitpriv;
   563		u32	res = _SUCCESS;
   564	
   565		if (!pxmitframe->buf_addr)
   566			return _FAIL;
   567	
   568		hw_hdr_offset = TXDESC_SIZE +
   569			 (pxmitframe->pkt_offset * PACKET_OFFSET_SZ);
   570		pframe = pxmitframe->buf_addr + hw_hdr_offset;
   571		/* 4 start to encrypt each fragment */
   572		if (pattrib->encrypt == _TKIP_) {
   573			if (pattrib->psta)
   574				stainfo = pattrib->psta;
   575			else
   576				stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]);
   577	
   578			if (stainfo) {
   579				if (is_multicast_ether_addr(pattrib->ra))
   580					prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
   581				else
   582					prwskey = &stainfo->dot118021x_UncstKey.skey[0];
   583	
   584				for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
   585					iv = pframe + pattrib->hdrlen;
   586					payload = pframe + pattrib->iv_len + pattrib->hdrlen;
   587	
   588					GET_TKIP_PN(iv, dot11txpn);
   589	
   590					pnl = (u16)(dot11txpn.val);
   591					pnh = (u32)(dot11txpn.val >> 16);
   592					phase1((u16 *)&ttkey[0], prwskey, &pattrib->ta[0], pnh);
   593					phase2(&rc4key[0], prwskey, (u16 *)&ttkey[0], pnl);
   594	
   595					if ((curfragnum + 1) == pattrib->nr_frags) {	/* 4 the last fragment */
   596						length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
 > 597						*((__le32 *)crc) = ~crc32_le(~0, payload, length);
   598	
   599						arcfour_init(&mycontext, rc4key, 16);
   600						arcfour_encrypt(&mycontext, payload, payload, length);
   601						arcfour_encrypt(&mycontext, payload + length, crc, 4);
   602					} else {
   603						length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
   604						*((__le32 *)crc) = ~crc32_le(~0, payload, length);
   605	
   606						arcfour_init(&mycontext, rc4key, 16);
   607						arcfour_encrypt(&mycontext, payload, payload, length);
   608						arcfour_encrypt(&mycontext, payload + length, crc, 4);
   609	
   610						pframe += pxmitpriv->frag_len;
   611						pframe = (u8 *)round_up((size_t)(pframe), 4);
   612					}
   613				}
   614			} else {
   615				res = _FAIL;
   616			}
   617		}
   618		return res;
   619	}
   620	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40008 bytes --]

  parent reply	other threads:[~2021-07-10  0:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 13:38 [PATCH] staging: rtl8188eu: Replace a custom function with crc32_le() Fabio M. De Francesco
2021-07-01 14:52 ` David Laight
2021-07-01 15:23   ` Fabio M. De Francesco
2021-07-01 15:54     ` David Laight
2021-07-01 16:10       ` Fabio M. De Francesco
2021-07-10  0:25 ` kernel test robot [this message]
2021-07-10 14:38   ` Fabio M. De Francesco
2021-07-10 20:42     ` David Laight
2021-07-13 12:50 ` Greg Kroah-Hartman
2021-07-13 17:52   ` Fabio M. De Francesco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107100829.RxcC1tei-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox