lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Jul 2021 09:15:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Shiraz Saleem <shiraz.saleem@...el.com>
Cc:     clang-built-linux@...glegroups.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Jason Gunthorpe <jgg@...dia.com>
Subject: drivers/infiniband/hw/irdma/uk.c:934:6: warning: variable
 'total_size' set but not used

Hi Shiraz,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e04360a2ea01bf42aa639b65aad81f502e896c7f
commit: fa0cf568fd76550c1ddb806c03a65a1a4a1ea909 RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw
date:   4 weeks ago
config: arm-randconfig-r005-20210701 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e7e71e9454ed76c1b3d8140170b5333c28bef1be)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fa0cf568fd76550c1ddb806c03a65a1a4a1ea909
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout fa0cf568fd76550c1ddb806c03a65a1a4a1ea909
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

>> drivers/infiniband/hw/irdma/uk.c:934:6: warning: variable 'total_size' set but not used [-Wunused-but-set-variable]
           u32 total_size = 0, wqe_idx, i, byte_off;
               ^
   1 warning generated.


vim +/total_size +934 drivers/infiniband/hw/irdma/uk.c

551c46edc7690c Mustafa Ismail 2021-06-02  925  
551c46edc7690c Mustafa Ismail 2021-06-02  926  /**
551c46edc7690c Mustafa Ismail 2021-06-02  927   * irdma_uk_post_receive - post receive wqe
551c46edc7690c Mustafa Ismail 2021-06-02  928   * @qp: hw qp ptr
551c46edc7690c Mustafa Ismail 2021-06-02  929   * @info: post rq information
551c46edc7690c Mustafa Ismail 2021-06-02  930   */
551c46edc7690c Mustafa Ismail 2021-06-02  931  enum irdma_status_code irdma_uk_post_receive(struct irdma_qp_uk *qp,
551c46edc7690c Mustafa Ismail 2021-06-02  932  					     struct irdma_post_rq_info *info)
551c46edc7690c Mustafa Ismail 2021-06-02  933  {
551c46edc7690c Mustafa Ismail 2021-06-02 @934  	u32 total_size = 0, wqe_idx, i, byte_off;
551c46edc7690c Mustafa Ismail 2021-06-02  935  	u32 addl_frag_cnt;
551c46edc7690c Mustafa Ismail 2021-06-02  936  	__le64 *wqe;
551c46edc7690c Mustafa Ismail 2021-06-02  937  	u64 hdr;
551c46edc7690c Mustafa Ismail 2021-06-02  938  
551c46edc7690c Mustafa Ismail 2021-06-02  939  	if (qp->max_rq_frag_cnt < info->num_sges)
551c46edc7690c Mustafa Ismail 2021-06-02  940  		return IRDMA_ERR_INVALID_FRAG_COUNT;
551c46edc7690c Mustafa Ismail 2021-06-02  941  
551c46edc7690c Mustafa Ismail 2021-06-02  942  	for (i = 0; i < info->num_sges; i++)
551c46edc7690c Mustafa Ismail 2021-06-02  943  		total_size += info->sg_list[i].len;
551c46edc7690c Mustafa Ismail 2021-06-02  944  
551c46edc7690c Mustafa Ismail 2021-06-02  945  	wqe = irdma_qp_get_next_recv_wqe(qp, &wqe_idx);
551c46edc7690c Mustafa Ismail 2021-06-02  946  	if (!wqe)
551c46edc7690c Mustafa Ismail 2021-06-02  947  		return IRDMA_ERR_QP_TOOMANY_WRS_POSTED;
551c46edc7690c Mustafa Ismail 2021-06-02  948  
551c46edc7690c Mustafa Ismail 2021-06-02  949  	qp->rq_wrid_array[wqe_idx] = info->wr_id;
551c46edc7690c Mustafa Ismail 2021-06-02  950  	addl_frag_cnt = info->num_sges > 1 ? (info->num_sges - 1) : 0;
551c46edc7690c Mustafa Ismail 2021-06-02  951  	qp->wqe_ops.iw_set_fragment(wqe, 0, info->sg_list,
551c46edc7690c Mustafa Ismail 2021-06-02  952  				    qp->rwqe_polarity);
551c46edc7690c Mustafa Ismail 2021-06-02  953  
551c46edc7690c Mustafa Ismail 2021-06-02  954  	for (i = 1, byte_off = 32; i < info->num_sges; i++) {
551c46edc7690c Mustafa Ismail 2021-06-02  955  		qp->wqe_ops.iw_set_fragment(wqe, byte_off, &info->sg_list[i],
551c46edc7690c Mustafa Ismail 2021-06-02  956  					    qp->rwqe_polarity);
551c46edc7690c Mustafa Ismail 2021-06-02  957  		byte_off += 16;
551c46edc7690c Mustafa Ismail 2021-06-02  958  	}
551c46edc7690c Mustafa Ismail 2021-06-02  959  
551c46edc7690c Mustafa Ismail 2021-06-02  960  	/* if not an odd number set valid bit in next fragment */
551c46edc7690c Mustafa Ismail 2021-06-02  961  	if (qp->uk_attrs->hw_rev >= IRDMA_GEN_2 && !(info->num_sges & 0x01) &&
551c46edc7690c Mustafa Ismail 2021-06-02  962  	    info->num_sges) {
551c46edc7690c Mustafa Ismail 2021-06-02  963  		qp->wqe_ops.iw_set_fragment(wqe, byte_off, NULL,
551c46edc7690c Mustafa Ismail 2021-06-02  964  					    qp->rwqe_polarity);
551c46edc7690c Mustafa Ismail 2021-06-02  965  		if (qp->uk_attrs->hw_rev == IRDMA_GEN_2)
551c46edc7690c Mustafa Ismail 2021-06-02  966  			++addl_frag_cnt;
551c46edc7690c Mustafa Ismail 2021-06-02  967  	}
551c46edc7690c Mustafa Ismail 2021-06-02  968  
551c46edc7690c Mustafa Ismail 2021-06-02  969  	set_64bit_val(wqe, 16, 0);
551c46edc7690c Mustafa Ismail 2021-06-02  970  	hdr = FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) |
551c46edc7690c Mustafa Ismail 2021-06-02  971  	      FIELD_PREP(IRDMAQPSQ_VALID, qp->rwqe_polarity);
551c46edc7690c Mustafa Ismail 2021-06-02  972  
551c46edc7690c Mustafa Ismail 2021-06-02  973  	dma_wmb(); /* make sure WQE is populated before valid bit is set */
551c46edc7690c Mustafa Ismail 2021-06-02  974  
551c46edc7690c Mustafa Ismail 2021-06-02  975  	set_64bit_val(wqe, 24, hdr);
551c46edc7690c Mustafa Ismail 2021-06-02  976  
551c46edc7690c Mustafa Ismail 2021-06-02  977  	return 0;
551c46edc7690c Mustafa Ismail 2021-06-02  978  }
551c46edc7690c Mustafa Ismail 2021-06-02  979  

:::::: The code at line 934 was first introduced by commit
:::::: 551c46edc7690c1656fbe44ef770ec4e6c004215 RDMA/irdma: Add user/kernel shared libraries

:::::: TO: Mustafa Ismail <mustafa.ismail@...el.com>
:::::: CC: Jason Gunthorpe <jgg@...dia.com>

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

Download attachment ".config.gz" of type "application/gzip" (50080 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ