All of lore.kernel.org
 help / color / mirror / Atom feed
* [jpirko-mlxsw:combined_queue 23/39] net/ethtool/cmis_cdb.c:574:40: warning: variable 'bytes_written' is uninitialized when used here
@ 2024-09-07 23:01 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-07 23:01 UTC (permalink / raw)
  To: Danielle Ratson; +Cc: llvm, oe-kbuild-all, Petr Machata

tree:   https://github.com/jpirko/linux_mlxsw combined_queue
head:   1e442c563723a4ecdef463c14b10ba919b27acdf
commit: 74c5ee4c97461509353a6a12028906809fe2c208 [23/39] net: ethtool: Add support for writing firmware blocks using EPL payload
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240908/202409080656.dUNiF2ts-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240908/202409080656.dUNiF2ts-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409080656.dUNiF2ts-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/ethtool/cmis_cdb.c:574:40: warning: variable 'bytes_written' is uninitialized when used here [-Wuninitialized]
     574 |              page <= CMIS_CDB_EPL_PAGE_END && bytes_written < epl_len; page++) {
         |                                               ^~~~~~~~~~~~~
   net/ethtool/cmis_cdb.c:569:19: note: initialize the variable 'bytes_written' to silence this warning
     569 |         u32 bytes_written;
         |                          ^
         |                           = 0
   1 warning generated.


vim +/bytes_written +574 net/ethtool/cmis_cdb.c

   562	
   563	static int
   564	ethtool_cmis_cdb_execute_epl_cmd(struct net_device *dev,
   565					 struct ethtool_cmis_cdb_cmd_args *args,
   566					 struct ethtool_module_eeprom *page_data)
   567	{
   568		u16 epl_len = be16_to_cpu(args->req.epl_len);
   569		u32 bytes_written;
   570		u8 page;
   571		int err;
   572	
   573		for (page = CMIS_CDB_EPL_PAGE_START;
 > 574		     page <= CMIS_CDB_EPL_PAGE_END && bytes_written < epl_len; page++) {
   575			u16 offset = CMIS_CDB_EPL_FW_BLOCK_OFFSET_START;
   576	
   577			while (offset <= CMIS_CDB_EPL_FW_BLOCK_OFFSET_END &&
   578			       bytes_written < epl_len) {
   579				u32 bytes_left = epl_len - bytes_written;
   580				u16 space_left, bytes_to_write;
   581	
   582				space_left = CMIS_CDB_EPL_FW_BLOCK_OFFSET_END - offset + 1;
   583				bytes_to_write = min_t(u16, bytes_left,
   584						       min_t(u16, space_left,
   585							     args->read_write_len_ext));
   586	
   587				err = __ethtool_cmis_cdb_execute_cmd(dev, page_data,
   588								     page, offset,
   589								     bytes_to_write,
   590								     args->req.epl + bytes_written);
   591				if (err < 0)
   592					return err;
   593	
   594				offset += bytes_to_write;
   595				bytes_written += bytes_to_write;
   596			}
   597		}
   598		return 0;
   599	}
   600	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-07 23:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-07 23:01 [jpirko-mlxsw:combined_queue 23/39] net/ethtool/cmis_cdb.c:574:40: warning: variable 'bytes_written' is uninitialized when used here kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.