Re: [PATCH v2] bug: fix problem including <linux/bug.h> from linux/kernel.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ian,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.12-rc2 next-20170524]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ian-Abbott/bug-fix-problem-including-linux-bug-h-from-linux-kernel-h/20170525-063508
config: x86_64-nfsroot (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/bug.h:81:0,
                    from include/linux/bug.h:4,
                    from arch/x86/purgatory/purgatory.c:13:
   include/asm-generic/bug.h:101:13: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
         struct pt_regs *regs, struct warn_args *args);
                ^~~~~~~
   arch/x86/purgatory/purgatory.c: In function 'verify_sha256_digest':
>> arch/x86/purgatory/purgatory.c:48:32: warning: implicit declaration of function 'ARRAY_SIZE' [-Wimplicit-function-declaration]
     end = purgatory_sha_regions + ARRAY_SIZE(purgatory_sha_regions);
                                   ^~~~~~~~~~
   In file included from arch/x86/include/asm/bug.h:81:0,
                    from include/linux/bug.h:4,
                    from include/linux/page-flags.h:9,
                    from kernel/bounds.c:9:
   include/asm-generic/bug.h:101:13: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
         struct pt_regs *regs, struct warn_args *args);
                ^~~~~~~

vim +/ARRAY_SIZE +48 arch/x86/purgatory/purgatory.c

8fc5b4d41 Vivek Goyal      2014-08-08   7   *       Vivek Goyal <vgoyal@xxxxxxxxxx>
8fc5b4d41 Vivek Goyal      2014-08-08   8   *
8fc5b4d41 Vivek Goyal      2014-08-08   9   * This source code is licensed under the GNU General Public License,
8fc5b4d41 Vivek Goyal      2014-08-08  10   * Version 2.  See the file COPYING for more details.
8fc5b4d41 Vivek Goyal      2014-08-08  11   */
8fc5b4d41 Vivek Goyal      2014-08-08  12  
40c50c1fe Thomas Gleixner  2017-03-10 @13  #include <linux/bug.h>
40c50c1fe Thomas Gleixner  2017-03-10  14  #include <asm/purgatory.h>
40c50c1fe Thomas Gleixner  2017-03-10  15  
8fc5b4d41 Vivek Goyal      2014-08-08  16  #include "sha256.h"
8fc5b4d41 Vivek Goyal      2014-08-08  17  #include "../boot/string.h"
8fc5b4d41 Vivek Goyal      2014-08-08  18  
40c50c1fe Thomas Gleixner  2017-03-10  19  unsigned long purgatory_backup_dest __section(.kexec-purgatory);
40c50c1fe Thomas Gleixner  2017-03-10  20  unsigned long purgatory_backup_src __section(.kexec-purgatory);
40c50c1fe Thomas Gleixner  2017-03-10  21  unsigned long purgatory_backup_sz __section(.kexec-purgatory);
8fc5b4d41 Vivek Goyal      2014-08-08  22  
40c50c1fe Thomas Gleixner  2017-03-10  23  u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(.kexec-purgatory);
8fc5b4d41 Vivek Goyal      2014-08-08  24  
40c50c1fe Thomas Gleixner  2017-03-10  25  struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX] __section(.kexec-purgatory);
8fc5b4d41 Vivek Goyal      2014-08-08  26  
8fc5b4d41 Vivek Goyal      2014-08-08  27  /*
8fc5b4d41 Vivek Goyal      2014-08-08  28   * On x86, second kernel requries first 640K of memory to boot. Copy
8fc5b4d41 Vivek Goyal      2014-08-08  29   * first 640K to a backup region in reserved memory range so that second
8fc5b4d41 Vivek Goyal      2014-08-08  30   * kernel can use first 640K.
8fc5b4d41 Vivek Goyal      2014-08-08  31   */
8fc5b4d41 Vivek Goyal      2014-08-08  32  static int copy_backup_region(void)
8fc5b4d41 Vivek Goyal      2014-08-08  33  {
40c50c1fe Thomas Gleixner  2017-03-10  34  	if (purgatory_backup_dest) {
40c50c1fe Thomas Gleixner  2017-03-10  35  		memcpy((void *)purgatory_backup_dest,
40c50c1fe Thomas Gleixner  2017-03-10  36  		       (void *)purgatory_backup_src, purgatory_backup_sz);
40c50c1fe Thomas Gleixner  2017-03-10  37  	}
8fc5b4d41 Vivek Goyal      2014-08-08  38  	return 0;
8fc5b4d41 Vivek Goyal      2014-08-08  39  }
8fc5b4d41 Vivek Goyal      2014-08-08  40  
72042a8c7 Tobin C. Harding 2017-02-20  41  static int verify_sha256_digest(void)
8fc5b4d41 Vivek Goyal      2014-08-08  42  {
40c50c1fe Thomas Gleixner  2017-03-10  43  	struct kexec_sha_region *ptr, *end;
8fc5b4d41 Vivek Goyal      2014-08-08  44  	u8 digest[SHA256_DIGEST_SIZE];
8fc5b4d41 Vivek Goyal      2014-08-08  45  	struct sha256_state sctx;
8fc5b4d41 Vivek Goyal      2014-08-08  46  
8fc5b4d41 Vivek Goyal      2014-08-08  47  	sha256_init(&sctx);
40c50c1fe Thomas Gleixner  2017-03-10 @48  	end = purgatory_sha_regions + ARRAY_SIZE(purgatory_sha_regions);
40c50c1fe Thomas Gleixner  2017-03-10  49  
40c50c1fe Thomas Gleixner  2017-03-10  50  	for (ptr = purgatory_sha_regions; ptr < end; ptr++)
8fc5b4d41 Vivek Goyal      2014-08-08  51  		sha256_update(&sctx, (uint8_t *)(ptr->start), ptr->len);

:::::: The code at line 48 was first introduced by commit
:::::: 40c50c1fecdf012a3bf055ec813f0ef2eda2749c kexec, x86/purgatory: Unbreak it and clean it up

:::::: TO: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux