All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [hch-misc:btrfs-bio-cleanup-part3 150/174] fs/btrfs/extent_io.c:7351:11: warning: Uninitialized variable: eb->start [uninitvar]
Date: Sat, 23 Apr 2022 22:57:21 +0800	[thread overview]
Message-ID: <202204232243.vHIq5kea-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: David Sterba <dsterba@suse.com>

tree:   git://git.infradead.org/users/hch/misc.git btrfs-bio-cleanup-part3
head:   50401c1bd218c77092656710b2fc11b3b246679f
commit: 729304c6cee94973c16115c985ba32a665bfacca [150/174] btrfs: Turn fs_info member buffer_radix into XArray
:::::: branch date: 9 hours ago
:::::: commit date: 17 hours ago
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 729304c6cee94973c16115c985ba32a665bfacca
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

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


cppcheck warnings: (new ones prefixed by >>)
                 ^
   fs/btrfs/extent_io.c:5984:7: warning: Local variable 'ret' shadows outer variable [shadowVariable]
     int ret;
         ^
   fs/btrfs/extent_io.c:5963:6: note: Shadowed declaration
    int ret;
        ^
   fs/btrfs/extent_io.c:5984:7: note: Shadow variable
     int ret;
         ^

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

                 ^
   fs/btrfs/extent_io.c:381:26: warning: Parameter 'p_in' can be declared with const [constParameter]
          struct rb_node ***p_in,
                            ^
   fs/btrfs/extent_io.c:382:25: warning: Parameter 'parent_in' can be declared with const [constParameter]
          struct rb_node **parent_in)
                           ^
   fs/btrfs/extent_io.c:1835:30: warning: Parameter 'mapping' can be declared with const [constParameter]
          struct address_space *mapping,
                                ^
   fs/btrfs/extent_io.c:1836:40: warning: Parameter 'locked_page' can be declared with const [constParameter]
          struct page *page, struct page *locked_page,
                                          ^
   fs/btrfs/extent_io.c:6084:16: warning: Parameter 'accessed' can be declared with const [constParameter]
     struct page *accessed)
                  ^
>> fs/btrfs/extent_io.c:7351:11: warning: Uninitialized variable: eb->start [uninitvar]
     if (eb->start >= page_start + PAGE_SIZE)
             ^

vim +7351 fs/btrfs/extent_io.c

6af118ce51b52c Chris Mason     2008-07-22  7337  
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7338  static struct extent_buffer *get_next_extent_buffer(
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7339  		struct btrfs_fs_info *fs_info, struct page *page, u64 bytenr)
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7340  {
729304c6cee949 Gabriel Niebler 2022-04-21  7341  	struct extent_buffer *eb;
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7342  	struct extent_buffer *found = NULL;
729304c6cee949 Gabriel Niebler 2022-04-21  7343  	unsigned long index;
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7344  	u64 page_start = page_offset(page);
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7345  
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7346  	ASSERT(in_range(bytenr, page_start, PAGE_SIZE));
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7347  	lockdep_assert_held(&fs_info->buffer_lock);
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7348  
729304c6cee949 Gabriel Niebler 2022-04-21  7349  	xa_for_each_start(&fs_info->extent_buffers, index, eb,
729304c6cee949 Gabriel Niebler 2022-04-21  7350  			  page_start >> fs_info->sectorsize_bits) {
729304c6cee949 Gabriel Niebler 2022-04-21 @7351  		if (eb->start >= page_start + PAGE_SIZE)
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7352  		        /* Already beyond page end */
729304c6cee949 Gabriel Niebler 2022-04-21  7353  			break;
729304c6cee949 Gabriel Niebler 2022-04-21  7354  		if (eb->start >= bytenr) {
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7355  			/* Found one */
729304c6cee949 Gabriel Niebler 2022-04-21  7356  			found = eb;
729304c6cee949 Gabriel Niebler 2022-04-21  7357  			break;
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7358  		}
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7359  	}
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7360  	return found;
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7361  }
d1e86e3fc34f24 Qu Wenruo       2021-01-26  7362  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-23 14:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204232243.vHIq5kea-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.