public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Isaku Yamahata <isaku.yamahata@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [intel-tdx:kvm-upstream-workaround 190/293] arch/x86/virt/vmx/tdx/tdx_debug.c:38:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Sat, 23 Apr 2022 06:51:39 +0800	[thread overview]
Message-ID: <202204230602.MCSINBa4-lkp@intel.com> (raw)

tree:   https://github.com/intel/tdx.git kvm-upstream-workaround
head:   d32e9a403c5c4f16dc577cbe92148e5b80f79d59
commit: eed43994431837da508aed7b50717777818c1837 [190/293] [REVERTME] debugfs to operation on TDX debug op
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20220423/202204230602.MCSINBa4-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
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/intel/tdx/commit/eed43994431837da508aed7b50717777818c1837
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx kvm-upstream-workaround
        git checkout eed43994431837da508aed7b50717777818c1837
        # 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 SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

>> arch/x86/virt/vmx/tdx/tdx_debug.c:38:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (debugconfig_supported) {
               ^~~~~~~~~~~~~~~~~~~~~
   arch/x86/virt/vmx/tdx/tdx_debug.c:46:10: note: uninitialized use occurs here
           return  ret;
                   ^~~
   arch/x86/virt/vmx/tdx/tdx_debug.c:38:2: note: remove the 'if' if its condition is always true
           if (debugconfig_supported) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/virt/vmx/tdx/tdx_debug.c:36:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +38 arch/x86/virt/vmx/tdx/tdx_debug.c

    32	
    33	static inline u64 tddebugconfig(u64 subleaf, u64 param1, u64 param2)
    34	{
    35		static bool debugconfig_supported = true;
    36		int ret;
    37	
  > 38		if (debugconfig_supported) {
    39			ret = __seamcall(SEAMCALL_TDDEBUGCONFIG, subleaf, param1, param2, 0, NULL);
    40			if (ret) {
    41				pr_info("DEBUGCONFIG SEAMCALL isn't supported.\n");
    42				debugconfig_supported = false;
    43			}
    44		}
    45	
    46		return  ret;
    47	}
    48	

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

                 reply	other threads:[~2022-04-22 22:52 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=202204230602.MCSINBa4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@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