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>] [day] [month] [year] [list]
Message-ID: <20201027070226.GI18329@kadam>
Date:   Tue, 27 Oct 2020 10:02:26 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org,
        Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Sujeev Dias <sdias@...eaurora.org>,
        Siddartha Mohanadoss <smohanad@...eaurora.org>,
        Jeffrey Hugo <jhugo@...eaurora.org>
Subject: [kbuild] drivers/bus/mhi/core/boot.c:222:3: warning: Variable 'i' is
 modified but its new value is never used.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   4525c8781ec0701ce824e8bd379ae1b129e26568
commit: cd457afb16670501f00354eb0e705a7d8a50d79d bus: mhi: core: Add support for downloading firmware over BHIe
compiler: powerpc64le-linux-gcc (GCC) 9.3.0

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/bus/mhi/core/boot.c:222:3: warning: Variable 'i' is modified but its new value is never used. [unreadVariable]
     i++;
     ^

vim +/i +222 drivers/bus/mhi/core/boot.c

cd457afb166705 Manivannan Sadhasivam 2020-02-20  203  static void mhi_firmware_copy(struct mhi_controller *mhi_cntrl,
cd457afb166705 Manivannan Sadhasivam 2020-02-20  204  			      const struct firmware *firmware,
cd457afb166705 Manivannan Sadhasivam 2020-02-20  205  			      struct image_info *img_info)
cd457afb166705 Manivannan Sadhasivam 2020-02-20  206  {
cd457afb166705 Manivannan Sadhasivam 2020-02-20  207  	size_t remainder = firmware->size;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  208  	size_t to_cpy;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  209  	const u8 *buf = firmware->data;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  210  	int i = 0;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  211  	struct mhi_buf *mhi_buf = img_info->mhi_buf;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  212  	struct bhi_vec_entry *bhi_vec = img_info->bhi_vec;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  213  
cd457afb166705 Manivannan Sadhasivam 2020-02-20  214  	while (remainder) {
cd457afb166705 Manivannan Sadhasivam 2020-02-20  215  		to_cpy = min(remainder, mhi_buf->len);
cd457afb166705 Manivannan Sadhasivam 2020-02-20  216  		memcpy(mhi_buf->buf, buf, to_cpy);
cd457afb166705 Manivannan Sadhasivam 2020-02-20  217  		bhi_vec->dma_addr = mhi_buf->dma_addr;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  218  		bhi_vec->size = to_cpy;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  219  
cd457afb166705 Manivannan Sadhasivam 2020-02-20  220  		buf += to_cpy;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  221  		remainder -= to_cpy;
cd457afb166705 Manivannan Sadhasivam 2020-02-20 @222  		i++;
                                                                ^^^^
Delete i.

cd457afb166705 Manivannan Sadhasivam 2020-02-20  223  		bhi_vec++;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  224  		mhi_buf++;
cd457afb166705 Manivannan Sadhasivam 2020-02-20  225  	}
cd457afb166705 Manivannan Sadhasivam 2020-02-20  226  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild@...ts.01.org
To unsubscribe send an email to kbuild-leave@...ts.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ