linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Jonathan Cavitt <jonathan.cavitt@intel.com>
Subject: [linux-next:master 5237/7353] drivers/gpu/drm/xe/xe_ggtt.c:714:3: error: variable 'total' is uninitialized when used here
Date: Thu, 29 Aug 2024 10:01:36 +0800	[thread overview]
Message-ID: <202408290916.B9yUmPQD-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   195a402a75791e6e0d96d9da27ca77671bc656a8
commit: 136367290ea5d7b5d05696189e9fd6162b9d9742 [5237/7353] drm/xe: Introduce xe_ggtt_print_holes
config: x86_64-randconfig-002-20240829 (https://download.01.org/0day-ci/archive/20240829/202408290916.B9yUmPQD-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/20240829/202408290916.B9yUmPQD-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/202408290916.B9yUmPQD-lkp@intel.com/

Note: the linux-next/master HEAD 195a402a75791e6e0d96d9da27ca77671bc656a8 builds fine.
      It may have been fixed somewhere.

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/xe/xe_ggtt.c:714:3: error: variable 'total' is uninitialized when used here [-Werror,-Wuninitialized]
     714 |                 total += hole_size;
         |                 ^~~~~
   drivers/gpu/drm/xe/xe_ggtt.c:702:11: note: initialize the variable 'total' to silence this warning
     702 |         u64 total;
         |                  ^
         |                   = 0
   1 error generated.


vim +/total +714 drivers/gpu/drm/xe/xe_ggtt.c

   685	
   686	/**
   687	 * xe_ggtt_print_holes - Print holes
   688	 * @ggtt: the &xe_ggtt to be inspected
   689	 * @alignment: min alignment
   690	 * @p: the &drm_printer
   691	 *
   692	 * Print GGTT ranges that are available and return total size available.
   693	 *
   694	 * Return: Total available size.
   695	 */
   696	u64 xe_ggtt_print_holes(struct xe_ggtt *ggtt, u64 alignment, struct drm_printer *p)
   697	{
   698		const struct drm_mm *mm = &ggtt->mm;
   699		const struct drm_mm_node *entry;
   700		u64 hole_min_start = xe_wopcm_size(tile_to_xe(ggtt->tile));
   701		u64 hole_start, hole_end, hole_size;
   702		u64 total;
   703		char buf[10];
   704	
   705		mutex_lock(&ggtt->lock);
   706	
   707		drm_mm_for_each_hole(entry, mm, hole_start, hole_end) {
   708			hole_start = max(hole_start, hole_min_start);
   709			hole_start = ALIGN(hole_start, alignment);
   710			hole_end = ALIGN_DOWN(hole_end, alignment);
   711			if (hole_start >= hole_end)
   712				continue;
   713			hole_size = hole_end - hole_start;
 > 714			total += hole_size;

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


                 reply	other threads:[~2024-08-29  2:02 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=202408290916.B9yUmPQD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jonathan.cavitt@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rodrigo.vivi@intel.com \
    /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