Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [davidhildenbrand:device_private 15/22] mm/damon/ops-common.c:50:17: warning: variable 'pteval' is uninitialized when used here
Date: Wed, 5 Feb 2025 17:09:53 +0800	[thread overview]
Message-ID: <202502051656.Xa4isdxU-lkp@intel.com> (raw)

tree:   https://github.com/davidhildenbrand/linux device_private
head:   ddc42f5fd72394838fc2d280ff2486ccb7178b9a
commit: 9440e0949cbc08fc248f6eacf05e4d47c48f1294 [15/22] mm/damon: handle device-exclusive entries correctly in damon_folio_mkold_one()
config: i386-buildonly-randconfig-005-20250205 (https://download.01.org/0day-ci/archive/20250205/202502051656.Xa4isdxU-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250205/202502051656.Xa4isdxU-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/202502051656.Xa4isdxU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/damon/ops-common.c:50:17: warning: variable 'pteval' is uninitialized when used here [-Wuninitialized]
      50 |                 pfn = pte_pfn(pteval);
         |                               ^~~~~~
   mm/damon/ops-common.c:47:2: note: variable 'pteval' is declared here
      47 |         pte_t pteval;
         |         ^
   1 warning generated.


vim +/pteval +50 mm/damon/ops-common.c

    41	
    42	void damon_ptep_mkold(pte_t *pte, struct vm_area_struct *vma, unsigned long addr)
    43	{
    44		struct folio *folio = damon_get_folio(pte_pfn(ptep_get(pte)));
    45		bool young = false;
    46		unsigned long pfn;
    47		pte_t pteval;
    48	
    49		if (likely(pte_present(pteval)))
  > 50			pfn = pte_pfn(pteval);
    51		else
    52			pfn = swp_offset_pfn(pte_to_swp_entry(pteval));
    53	
    54		folio = damon_get_folio(pfn);
    55		if (!folio)
    56			return;
    57	
    58		/*
    59		 * PFN swap entries, such as device-exclusive ones, are "old" from a
    60		 * CPU perspective.
    61		 */
    62		if (likely(pte_present(pteval)))
    63			young |= ptep_test_and_clear_young(vma, addr, pte);
    64		young |= mmu_notifier_clear_young(vma->vm_mm, addr, addr + PAGE_SIZE);
    65		if (young)
    66			folio_set_young(folio);
    67	
    68		folio_set_idle(folio);
    69		folio_put(folio);
    70	}
    71	

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

                 reply	other threads:[~2025-02-05  9:10 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=202502051656.Xa4isdxU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=david@redhat.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox