linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: kbuild-all@01.org, Guo Ren <ren_guo@c-sky.com>,
	Juergen Gross <jgross@suse.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 8266/8290] arch/xtensa/mm/kasan_init.c:49:35: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'long unsigned int'
Date: Fri, 15 Feb 2019 07:26:21 +0800	[thread overview]
Message-ID: <201902150710.iERneFPC%fengguang.wu@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c4f3ef3eb53fd7e8cbfe200d5ff6dba2b08526b5
commit: 5107c1e0490f01323cf3296f758271b06d9bb0f9 [8266/8290] treewide: add checks for the return value of memblock_alloc*()
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 5107c1e0490f01323cf3296f758271b06d9bb0f9
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   arch/xtensa/mm/kasan_init.c: In function 'populate':
>> arch/xtensa/mm/kasan_init.c:49:35: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'long unsigned int' [-Wformat=]
      panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
                                    ~~^
                                    %lu
            __func__, n_pages * sizeof(pte_t), PAGE_SIZE);
                      ~~~~~~~~~~~~~~~~~~~~~~~

vim +49 arch/xtensa/mm/kasan_init.c

    37	
    38	static void __init populate(void *start, void *end)
    39	{
    40		unsigned long n_pages = (end - start) / PAGE_SIZE;
    41		unsigned long n_pmds = n_pages / PTRS_PER_PTE;
    42		unsigned long i, j;
    43		unsigned long vaddr = (unsigned long)start;
    44		pgd_t *pgd = pgd_offset_k(vaddr);
    45		pmd_t *pmd = pmd_offset(pgd, vaddr);
    46		pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE);
    47	
    48		if (!pte)
  > 49			panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
    50			      __func__, n_pages * sizeof(pte_t), PAGE_SIZE);
    51	
    52		pr_debug("%s: %p - %p\n", __func__, start, end);
    53	
    54		for (i = j = 0; i < n_pmds; ++i) {
    55			int k;
    56	
    57			for (k = 0; k < PTRS_PER_PTE; ++k, ++j) {
    58				phys_addr_t phys =
    59					memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
    60	
    61				if (!phys)
    62					panic("Failed to allocate page table page\n");
    63	
    64				set_pte(pte + j, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL));
    65			}
    66		}
    67	
    68		for (i = 0; i < n_pmds ; ++i, pte += PTRS_PER_PTE)
    69			set_pmd(pmd + i, __pmd((unsigned long)pte));
    70	
    71		local_flush_tlb_all();
    72		memset(start, 0, end - start);
    73	}
    74	

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

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

             reply	other threads:[~2019-02-14 23:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 23:26 kbuild test robot [this message]
2019-02-15 18:49 ` Andrew Morton

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=201902150710.iERneFPC%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=jgross@suse.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=ren_guo@c-sky.com \
    --cc=rppt@linux.ibm.com \
    /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