public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [dcui-tdx:decui/michaelv7dda/tdx/v4-dda 3/14] kernel/dma/swiotlb.c:218:6: warning: variable 'rc' is uninitialized when used here
@ 2023-04-08  8:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-04-08  8:25 UTC (permalink / raw)
  To: Dexuan Cui; +Cc: llvm, oe-kbuild-all

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

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

only message in thread, other threads:[~2023-04-08  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-08  8:25 [dcui-tdx:decui/michaelv7dda/tdx/v4-dda 3/14] kernel/dma/swiotlb.c:218:6: warning: variable 'rc' is uninitialized when used here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox