[kbuild] drivers/bus/mhi/core/boot.c:222:3: warning: Variable 'i' is modified but its new value is never used.
From: Dan Carpenter
Date: Tue Oct 27 2020 - 03:04:45 EST
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@xxxxxxxxx>
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@xxxxxxxxxxxx
_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx