All of lore.kernel.org
 help / color / mirror / Atom feed
* [arnd-playground:to-build 156/350] drivers/mtd/ubi/eba.c:988:9: warning: 'opnum' may be used uninitialized in this function
@ 2020-12-01 23:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-01 23:45 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git to-build
head:   fe197c065a93b860c59017cf6933889c69842ef7
commit: ccdf29995afd5e0db83531b7cf4b6f6ad8807db5 [156/350] move warning settings into header
config: parisc-randconfig-r002-20201201 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commit/?id=ccdf29995afd5e0db83531b7cf4b6f6ad8807db5
        git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
        git fetch --no-tags arnd-playground to-build
        git checkout ccdf29995afd5e0db83531b7cf4b6f6ad8807db5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/mtd/ubi/eba.c: In function 'try_write_vid_and_data':
>> drivers/mtd/ubi/eba.c:988:9: warning: 'opnum' may be used uninitialized in this function [-Wmaybe-uninitialized]
     988 |   err = ubi_wl_put_peb(ubi, vol_id, lnum, opnum, 0);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/ubi/eba.c: In function 'ubi_eba_read_leb':
   drivers/mtd/ubi/eba.c:714:4: warning: 'crc' may be used uninitialized in this function [-Wmaybe-uninitialized]
     714 |    ubi_warn(ubi, "CRC error: calculated %#08x, must be %#08x",
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     715 |      crc1, crc);
         |      ~~~~~~~~~~
--
   drivers/mtd/ubi/fastmap.c: In function 'ubi_attach_fastmap':
>> drivers/mtd/ubi/fastmap.c:755:31: warning: taking address of packed member of 'struct ubi_fm_scan_pool' may result in an unaligned pointer value [-Waddress-of-packed-member]
     755 |  ret = scan_pool(ubi, ai, fmpl->pebs, pool_size, &max_sqnum, &free);
         |                           ~~~~^~~~~~
   drivers/mtd/ubi/fastmap.c:759:34: warning: taking address of packed member of 'struct ubi_fm_scan_pool' may result in an unaligned pointer value [-Waddress-of-packed-member]
     759 |  ret = scan_pool(ubi, ai, fmpl_wl->pebs, wl_pool_size, &max_sqnum, &free);
         |                           ~~~~~~~^~~~~~
--
   fs/exfat/inode.c: In function '__exfat_write_inode':
>> fs/exfat/inode.c:56:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      56 |    &ep->dentry.file.create_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:57:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      57 |    &ep->dentry.file.create_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:61:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      61 |    &ep->dentry.file.modify_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:62:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      62 |    &ep->dentry.file.modify_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:66:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      66 |    &ep->dentry.file.access_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/inode.c:67:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
      67 |    &ep->dentry.file.access_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   fs/exfat/dir.c: In function 'exfat_init_dir_entry':
>> fs/exfat/dir.c:456:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     456 |    &ep->dentry.file.create_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:457:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     457 |    &ep->dentry.file.create_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:461:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     461 |    &ep->dentry.file.modify_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:462:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     462 |    &ep->dentry.file.modify_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:466:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     466 |    &ep->dentry.file.access_time,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/dir.c:467:4: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     467 |    &ep->dentry.file.access_date,
         |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   fs/exfat/file.c: In function '__exfat_truncate':
>> fs/exfat/file.c:169:5: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     169 |     &ep->dentry.file.modify_time,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/exfat/file.c:170:5: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
     170 |     &ep->dentry.file.modify_date,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   fs/hfsplus/super.c: In function 'hfsplus_fill_super':
>> fs/hfsplus/super.c:547:16: warning: taking address of packed member of 'struct hfsplus_vh' may result in an unaligned pointer value [-Waddress-of-packed-member]
     547 |   be32_add_cpu(&vhdr->write_count, 1);
         |                ^~~~~~~~~~~~~~~~~~
--
   fs/hfsplus/unicode.c: In function 'hfsplus_strcasecmp':
>> fs/hfsplus/unicode.c:40:7: warning: taking address of packed member of 'struct hfsplus_unistr' may result in an unaligned pointer value [-Waddress-of-packed-member]
      40 |  p1 = s1->unicode;
         |       ^~
   fs/hfsplus/unicode.c:41:7: warning: taking address of packed member of 'struct hfsplus_unistr' may result in an unaligned pointer value [-Waddress-of-packed-member]
      41 |  p2 = s2->unicode;
         |       ^~
   fs/hfsplus/unicode.c: In function 'hfsplus_strcmp':
   fs/hfsplus/unicode.c:74:7: warning: taking address of packed member of 'struct hfsplus_unistr' may result in an unaligned pointer value [-Waddress-of-packed-member]
      74 |  p1 = s1->unicode;
         |       ^~
   fs/hfsplus/unicode.c:75:7: warning: taking address of packed member of 'struct hfsplus_unistr' may result in an unaligned pointer value [-Waddress-of-packed-member]
      75 |  p2 = s2->unicode;
         |       ^~
   fs/hfsplus/unicode.c: In function 'hfsplus_uni2asc':
   fs/hfsplus/unicode.c:134:7: warning: taking address of packed member of 'struct hfsplus_unistr' may result in an unaligned pointer value [-Waddress-of-packed-member]
     134 |  ip = ustr->unicode;
         |       ^~~~
--
   fs/hfsplus/part_tbl.c: In function 'hfs_parse_old_pmap':
>> fs/hfsplus/part_tbl.c:77:30: warning: taking address of packed member of 'struct old_pmap' may result in an unaligned pointer value [-Waddress-of-packed-member]
      77 |   struct old_pmap_entry *p = &pm->pdEntry[i];
         |                              ^~~~~~~~~~~~~~~
--
   fs/hfsplus/xattr.c: In function 'hfsplus_init_header_node':
>> fs/hfsplus/xattr.c:104:16: warning: taking address of packed member of 'struct hfs_btree_header_rec' may result in an unaligned pointer value [-Waddress-of-packed-member]
     104 |   be32_add_cpu(&head->free_nodes, 0 - map_nodes);
         |                ^~~~~~~~~~~~~~~~~
--
   fs/hfs/btree.c: In function 'hfs_btree_open':
>> fs/hfs/btree.c:48:39: warning: taking address of packed member of 'struct hfs_mdb' may result in an unaligned pointer value [-Waddress-of-packed-member]
      48 |   hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
         |                                    ~~~^~~~~~~~~~~~
   fs/hfs/btree.c:60:39: warning: taking address of packed member of 'struct hfs_mdb' may result in an unaligned pointer value [-Waddress-of-packed-member]
      60 |   hfs_inode_read_fork(tree->inode, mdb->drCTExtRec, mdb->drCTFlSize,
         |                                    ~~~^~~~~~~~~~~~
--
   fs/hfs/extent.c: In function 'hfs_free_fork':
>> fs/hfs/extent.c:297:12: warning: taking address of packed member of 'struct hfs_cat_file' may result in an unaligned pointer value [-Waddress-of-packed-member]
     297 |   extent = file->ExtRec;
         |            ^~~~
   fs/hfs/extent.c:300:12: warning: taking address of packed member of 'struct hfs_cat_file' may result in an unaligned pointer value [-Waddress-of-packed-member]
     300 |   extent = file->RExtRec;
         |            ^~~~
..

vim +/opnum +988 drivers/mtd/ubi/eba.c

801c135ce73d5df Artem B. Bityutskiy 2006-06-27  929  
2d78aee426d821b Boris Brezillon     2016-09-16  930  /**
2d78aee426d821b Boris Brezillon     2016-09-16  931   * try_write_vid_and_data - try to write VID header and data to a new PEB.
2d78aee426d821b Boris Brezillon     2016-09-16  932   * @vol: volume description object
2d78aee426d821b Boris Brezillon     2016-09-16  933   * @lnum: logical eraseblock number
3291b52f9ff0acc Boris Brezillon     2016-09-16  934   * @vidb: the VID buffer to write
2d78aee426d821b Boris Brezillon     2016-09-16  935   * @buf: buffer containing the data
2d78aee426d821b Boris Brezillon     2016-09-16  936   * @offset: where to start writing data
2d78aee426d821b Boris Brezillon     2016-09-16  937   * @len: how many bytes should be written
2d78aee426d821b Boris Brezillon     2016-09-16  938   *
2d78aee426d821b Boris Brezillon     2016-09-16  939   * This function tries to write VID header and data belonging to logical
2d78aee426d821b Boris Brezillon     2016-09-16  940   * eraseblock @lnum of volume @vol to a new physical eraseblock. Returns zero
2d78aee426d821b Boris Brezillon     2016-09-16  941   * in case of success and a negative error code in case of failure.
2d78aee426d821b Boris Brezillon     2016-09-16  942   * In case of error, it is possible that something was still written to the
2d78aee426d821b Boris Brezillon     2016-09-16  943   * flash media, but may be some garbage.
2d78aee426d821b Boris Brezillon     2016-09-16  944   */
2d78aee426d821b Boris Brezillon     2016-09-16  945  static int try_write_vid_and_data(struct ubi_volume *vol, int lnum,
3291b52f9ff0acc Boris Brezillon     2016-09-16  946  				  struct ubi_vid_io_buf *vidb, const void *buf,
2d78aee426d821b Boris Brezillon     2016-09-16  947  				  int offset, int len)
2d78aee426d821b Boris Brezillon     2016-09-16  948  {
2d78aee426d821b Boris Brezillon     2016-09-16  949  	struct ubi_device *ubi = vol->ubi;
2d78aee426d821b Boris Brezillon     2016-09-16  950  	int pnum, opnum, err, vol_id = vol->vol_id;
2d78aee426d821b Boris Brezillon     2016-09-16  951  
2d78aee426d821b Boris Brezillon     2016-09-16  952  	pnum = ubi_wl_get_peb(ubi);
2d78aee426d821b Boris Brezillon     2016-09-16  953  	if (pnum < 0) {
2d78aee426d821b Boris Brezillon     2016-09-16  954  		err = pnum;
2d78aee426d821b Boris Brezillon     2016-09-16  955  		goto out_put;
2d78aee426d821b Boris Brezillon     2016-09-16  956  	}
2d78aee426d821b Boris Brezillon     2016-09-16  957  
799dca34ac54348 Boris Brezillon     2016-09-16  958  	opnum = vol->eba_tbl->entries[lnum].pnum;
2d78aee426d821b Boris Brezillon     2016-09-16  959  
2d78aee426d821b Boris Brezillon     2016-09-16  960  	dbg_eba("write VID hdr and %d bytes at offset %d of LEB %d:%d, PEB %d",
2d78aee426d821b Boris Brezillon     2016-09-16  961  		len, offset, vol_id, lnum, pnum);
2d78aee426d821b Boris Brezillon     2016-09-16  962  
3291b52f9ff0acc Boris Brezillon     2016-09-16  963  	err = ubi_io_write_vid_hdr(ubi, pnum, vidb);
2d78aee426d821b Boris Brezillon     2016-09-16  964  	if (err) {
2d78aee426d821b Boris Brezillon     2016-09-16  965  		ubi_warn(ubi, "failed to write VID header to LEB %d:%d, PEB %d",
2d78aee426d821b Boris Brezillon     2016-09-16  966  			 vol_id, lnum, pnum);
2d78aee426d821b Boris Brezillon     2016-09-16  967  		goto out_put;
2d78aee426d821b Boris Brezillon     2016-09-16  968  	}
2d78aee426d821b Boris Brezillon     2016-09-16  969  
2d78aee426d821b Boris Brezillon     2016-09-16  970  	if (len) {
2d78aee426d821b Boris Brezillon     2016-09-16  971  		err = ubi_io_write_data(ubi, buf, pnum, offset, len);
2d78aee426d821b Boris Brezillon     2016-09-16  972  		if (err) {
2d78aee426d821b Boris Brezillon     2016-09-16  973  			ubi_warn(ubi,
2d78aee426d821b Boris Brezillon     2016-09-16  974  				 "failed to write %d bytes at offset %d of LEB %d:%d, PEB %d",
2d78aee426d821b Boris Brezillon     2016-09-16  975  				 len, offset, vol_id, lnum, pnum);
2d78aee426d821b Boris Brezillon     2016-09-16  976  			goto out_put;
2d78aee426d821b Boris Brezillon     2016-09-16  977  		}
2d78aee426d821b Boris Brezillon     2016-09-16  978  	}
2d78aee426d821b Boris Brezillon     2016-09-16  979  
799dca34ac54348 Boris Brezillon     2016-09-16  980  	vol->eba_tbl->entries[lnum].pnum = pnum;
2d78aee426d821b Boris Brezillon     2016-09-16  981  
2d78aee426d821b Boris Brezillon     2016-09-16  982  out_put:
2d78aee426d821b Boris Brezillon     2016-09-16  983  	up_read(&ubi->fm_eba_sem);
2d78aee426d821b Boris Brezillon     2016-09-16  984  
2d78aee426d821b Boris Brezillon     2016-09-16  985  	if (err && pnum >= 0)
2d78aee426d821b Boris Brezillon     2016-09-16  986  		err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1);
2d78aee426d821b Boris Brezillon     2016-09-16  987  	else if (!err && opnum >= 0)
2d78aee426d821b Boris Brezillon     2016-09-16 @988  		err = ubi_wl_put_peb(ubi, vol_id, lnum, opnum, 0);
2d78aee426d821b Boris Brezillon     2016-09-16  989  
2d78aee426d821b Boris Brezillon     2016-09-16  990  	return err;
2d78aee426d821b Boris Brezillon     2016-09-16  991  }
2d78aee426d821b Boris Brezillon     2016-09-16  992  

:::::: The code at line 988 was first introduced by commit
:::::: 2d78aee426d821bbecbc80ee96ada5730ee68b6f UBI: simplify LEB write and atomic LEB change code

:::::: TO: Boris Brezillon <boris.brezillon@free-electrons.com>
:::::: CC: Richard Weinberger <richard@nod.at>

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

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

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

only message in thread, other threads:[~2020-12-01 23:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 23:45 [arnd-playground:to-build 156/350] drivers/mtd/ubi/eba.c:988:9: warning: 'opnum' may be used uninitialized in this function 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.