All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [ihalip:KSPP20 1/1] arch/x86/kvm/svm/svm.c:115:13: error: static declaration of 'npt_enabled' follows non-static declaration
Date: Thu, 23 Apr 2020 16:17:39 +0800	[thread overview]
Message-ID: <202004231631.QJmt7viV%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4642 bytes --]

tree:   https://github.com/ihalip/linux KSPP20
head:   7cf3fadf5610fa720dcd292d550c2106162983f6
commit: 7cf3fadf5610fa720dcd292d550c2106162983f6 [1/1] mark some variables as __ro_after_init
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
        git checkout 7cf3fadf5610fa720dcd292d550c2106162983f6
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All errors (new ones prefixed by >>):

>> arch/x86/kvm/svm/svm.c:115:13: error: static declaration of 'npt_enabled' follows non-static declaration
    static bool npt_enabled __ro_after_init = true;
                ^~~~~~~~~~~
   In file included from arch/x86/kvm/svm/svm.c:42:0:
   arch/x86/kvm/svm/svm.h:36:13: note: previous declaration of 'npt_enabled' was here
    extern bool npt_enabled;
                ^~~~~~~~~~~

cppcheck warnings: (new ones prefixed by >>)

   arch/x86/kernel/apic/x2apic_uv_x.c:1283:22: warning: Either the condition 'order<sizeof(suffix)' is redundant or the array 'suffix[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond]
      flag, size, suffix[order],
                        ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1265:31: note: Assuming that condition 'order<sizeof(suffix)' is not redundant
     while (size > 9999 && order < sizeof(suffix)) {
                                 ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1283:22: note: Array index out of bounds
      flag, size, suffix[order],
                        ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1366:25: warning: The statement 'if (uv_possible_blades!=uv_pb) uv_possible_blades=uv_pb' is logically equivalent to 'uv_possible_blades=uv_pb'. [duplicateConditionalAssign]
    if (uv_possible_blades != uv_pb)
                           ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1367:22: note: Assignment 'uv_possible_blades=uv_pb'
     uv_possible_blades = uv_pb;
                        ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1366:25: note: Condition 'uv_possible_blades!=uv_pb' is redundant
    if (uv_possible_blades != uv_pb)
                           ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1616:4: warning: Either the condition '!new_hub' is redundant or there is possible null pointer dereference: new_hub. [nullPointerRedundantCheck]
     *new_hub = hub_info;
      ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1615:10: note: Assuming that condition '!new_hub' is not redundant
     BUG_ON(!new_hub);
            ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1614:29: note: Assignment 'new_hub=uv_hub_info_list(nodeid)', assigned value is 0
     new_hub = uv_hub_info_list(nodeid);
                               ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1616:4: note: Null pointer dereference
     *new_hub = hub_info;
      ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1448:12: warning: Variable 'lnid' is reassigned a value before the old one has been used. [redundantAssignment]
    for (lnid = 0; lnid < num_possible_nodes(); lnid++) {
              ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1435:8: note: lnid is assigned
     lnid = nid;
          ^
   arch/x86/kernel/apic/x2apic_uv_x.c:1448:12: note: lnid is overwritten
    for (lnid = 0; lnid < num_possible_nodes(); lnid++) {
              ^
   arch/x86/kernel/apic/x2apic_uv_x.c:232:31: warning: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]
    uv_cpuid.apicid_mask = (~(-1 << sid_shift));
                                 ^
>> arch/x86/kernel/apic/x2apic_uv_x.c:254:47: warning: Local variable 'apicid_mask' shadows outer variable [shadowVariable]
    union uv1h_lb_target_physical_apic_id_mask_u apicid_mask;
                                                 ^
   arch/x86/kernel/apic/x2apic_uv_x.c:48:15: note: Shadowed declaration
    unsigned int apicid_mask;
                 ^
   arch/x86/kernel/apic/x2apic_uv_x.c:254:47: note: Shadow variable
    union uv1h_lb_target_physical_apic_id_mask_u apicid_mask;
                                                 ^

vim +/npt_enabled +115 arch/x86/kvm/svm/svm.c

   112	
   113	/* enable NPT for AMD64 and X86 with PAE */
   114	#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
 > 115	static bool npt_enabled __ro_after_init = true;
   116	#else
   117	static bool npt_enabled __ro_after_init;
   118	#endif
   119	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73409 bytes --]

                 reply	other threads:[~2020-04-23  8:17 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=202004231631.QJmt7viV%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.