public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [dcui-tdx:decui/michaelv7dda/tdx/v4-dda 3/14] kernel/dma/swiotlb.c:218:6: warning: variable 'rc' is uninitialized when used here
Date: Sat, 8 Apr 2023 16:25:09 +0800	[thread overview]
Message-ID: <202304081641.C8lyXUZX-lkp@intel.com> (raw)

tree:   https://github.com/dcui/tdx decui/michaelv7dda/tdx/v4-dda
head:   bd34cfc6af2bd56b3f4bf2fe22aa6f293ae223cd
commit: 736345bba3e33ac9ea55c13f4dbfd765b70dffb1 [3/14] swiotlb: check set_memory_decrypted()'s return value
config: x86_64-randconfig-a003-20230403 (https://download.01.org/0day-ci/archive/20230408/202304081641.C8lyXUZX-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://github.com/dcui/tdx/commit/736345bba3e33ac9ea55c13f4dbfd765b70dffb1
        git remote add dcui-tdx https://github.com/dcui/tdx
        git fetch --no-tags dcui-tdx decui/michaelv7dda/tdx/v4-dda
        git checkout 736345bba3e33ac9ea55c13f4dbfd765b70dffb1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/dma/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304081641.C8lyXUZX-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/dma/swiotlb.c:218:6: warning: variable 'rc' is uninitialized when used here [-Wuninitialized]
           if (rc) {
               ^~
   kernel/dma/swiotlb.c:212:8: note: initialize the variable 'rc' to silence this warning
           int rc;
                 ^
                  = 0
   1 warning generated.


vim +/rc +218 kernel/dma/swiotlb.c

   201	
   202	/*
   203	 * Early SWIOTLB allocation may be too early to allow an architecture to
   204	 * perform the desired operations.  This function allows the architecture to
   205	 * call SWIOTLB when the operations are possible.  It needs to be called
   206	 * before the SWIOTLB memory is used.
   207	 */
   208	void __init swiotlb_update_mem_attributes(void)
   209	{
   210		struct io_tlb_mem *mem = &io_tlb_default_mem;
   211		unsigned long bytes;
   212		int rc;
   213	
   214		if (!mem->nslabs || mem->late_alloc)
   215			return;
   216		bytes = PAGE_ALIGN(mem->nslabs << IO_TLB_SHIFT);
   217		set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT);
 > 218		if (rc) {
   219			pr_err("Failed to decrypt swiotlb buffer (%d): disabling swiotlb!\n",
   220			       rc);
   221			mem->nslabs = 0;
   222			return;
   223		}
   224	}
   225	

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

                 reply	other threads:[~2023-04-08  8:25 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=202304081641.C8lyXUZX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=decui@microsoft.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