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, Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [mmotm:master 292/305] kernel/dma/swiotlb.c:210:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'}
Date: Thu, 31 Jan 2019 21:55:02 +0800	[thread overview]
Message-ID: <201901312100.HARDh9Yx%fengguang.wu@intel.com> (raw)

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

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   a4186de8d65ec2ca6c39070ef1d6795a0b4ffe04
commit: ed3a4b0e077d27416ac3f9bb37ee64e59f73b088 [292/305] swiotlb: add checks for the return value of memblock_alloc*()
config: i386-allmodconfig (attached as .config)
compiler: gcc-8 (Debian 8.2.0-14) 8.2.0
reproduce:
        git checkout ed3a4b0e077d27416ac3f9bb37ee64e59f73b088
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   kernel/dma/swiotlb.c: In function 'swiotlb_init_with_tbl':
>> kernel/dma/swiotlb.c:210:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
      panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
                                    ~~^
                                    %u
            __func__, alloc_size, PAGE_SIZE);
                      ~~~~~~~~~~       
   kernel/dma/swiotlb.c:216:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
      panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
                                    ~~^
                                    %u
            __func__, alloc_size, PAGE_SIZE);
                      ~~~~~~~~~~       

vim +210 kernel/dma/swiotlb.c

   190	
   191	int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
   192	{
   193		unsigned long i, bytes;
   194		size_t alloc_size;
   195	
   196		bytes = nslabs << IO_TLB_SHIFT;
   197	
   198		io_tlb_nslabs = nslabs;
   199		io_tlb_start = __pa(tlb);
   200		io_tlb_end = io_tlb_start + bytes;
   201	
   202		/*
   203		 * Allocate and initialize the free list array.  This array is used
   204		 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
   205		 * between io_tlb_start and io_tlb_end.
   206		 */
   207		alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(int));
   208		io_tlb_list = memblock_alloc(alloc_size, PAGE_SIZE);
   209		if (!io_tlb_list)
 > 210			panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
   211			      __func__, alloc_size, PAGE_SIZE);
   212	
   213		alloc_size = PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t));
   214		io_tlb_orig_addr = memblock_alloc(alloc_size, PAGE_SIZE);
   215		if (!io_tlb_orig_addr)
   216			panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
   217			      __func__, alloc_size, PAGE_SIZE);
   218	
   219		for (i = 0; i < io_tlb_nslabs; i++) {
   220			io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
   221			io_tlb_orig_addr[i] = INVALID_PHYS_ADDR;
   222		}
   223		io_tlb_index = 0;
   224	
   225		if (verbose)
   226			swiotlb_print_info();
   227	
   228		swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT);
   229		return 0;
   230	}
   231	

---
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: 66830 bytes --]

                 reply	other threads:[~2019-01-31 13:55 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=201901312100.HARDh9Yx%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --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