All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:android-4.19 1/4] drivers/staging/android/ion/ion_system_heap.c:292:5: warning: no previous prototype for function 'ion_system_heap_create'
@ 2020-11-18 12:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-18 12:59 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://android.googlesource.com/kernel/common android-4.19
head:   983e2cdf34d065dd89e93bd096a76994b29aebcd
commit: f64a8b79c0e85440319136ed928f22ed37481742 [1/4] ANDROID: staging: android: ion: enable modularizing the ion driver
config: x86_64-randconfig-a015-20201118 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b2613fb2f0f53691dd0211895afbb9413457fca7)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git remote add android-common https://android.googlesource.com/kernel/common
        git fetch --no-tags android-common android-4.19
        git checkout f64a8b79c0e85440319136ed928f22ed37481742
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>):

>> drivers/staging/android/ion/ion_system_heap.c:292:5: warning: no previous prototype for function 'ion_system_heap_create' [-Wmissing-prototypes]
   int ion_system_heap_create(void)
       ^
   drivers/staging/android/ion/ion_system_heap.c:292:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int ion_system_heap_create(void)
   ^
   static 
>> drivers/staging/android/ion/ion_system_heap.c:385:5: warning: no previous prototype for function 'ion_system_contig_heap_create' [-Wmissing-prototypes]
   int ion_system_contig_heap_create(void)
       ^
   drivers/staging/android/ion/ion_system_heap.c:385:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int ion_system_contig_heap_create(void)
   ^
   static 
   2 warnings generated.

vim +/ion_system_heap_create +292 drivers/staging/android/ion/ion_system_heap.c

   291	
 > 292	int ion_system_heap_create(void)
   293	{
   294		struct ion_heap *heap;
   295	
   296		heap = __ion_system_heap_create();
   297		if (IS_ERR(heap))
   298			return PTR_ERR(heap);
   299		heap->name = "ion_system_heap";
   300	
   301		ion_device_add_heap(heap);
   302		return 0;
   303	}
   304	
   305	static int ion_system_contig_heap_allocate(struct ion_heap *heap,
   306						   struct ion_buffer *buffer,
   307						   unsigned long len,
   308						   unsigned long flags)
   309	{
   310		int order = get_order(len);
   311		struct page *page;
   312		struct sg_table *table;
   313		unsigned long i;
   314		int ret;
   315	
   316		page = alloc_pages(low_order_gfp_flags | __GFP_NOWARN, order);
   317		if (!page)
   318			return -ENOMEM;
   319	
   320		split_page(page, order);
   321	
   322		len = PAGE_ALIGN(len);
   323		for (i = len >> PAGE_SHIFT; i < (1 << order); i++)
   324			__free_page(page + i);
   325	
   326		table = kmalloc(sizeof(*table), GFP_KERNEL);
   327		if (!table) {
   328			ret = -ENOMEM;
   329			goto free_pages;
   330		}
   331	
   332		ret = sg_alloc_table(table, 1, GFP_KERNEL);
   333		if (ret)
   334			goto free_table;
   335	
   336		sg_set_page(table->sgl, page, len, 0);
   337	
   338		buffer->sg_table = table;
   339	
   340		return 0;
   341	
   342	free_table:
   343		kfree(table);
   344	free_pages:
   345		for (i = 0; i < len >> PAGE_SHIFT; i++)
   346			__free_page(page + i);
   347	
   348		return ret;
   349	}
   350	
   351	static void ion_system_contig_heap_free(struct ion_buffer *buffer)
   352	{
   353		struct sg_table *table = buffer->sg_table;
   354		struct page *page = sg_page(table->sgl);
   355		unsigned long pages = PAGE_ALIGN(buffer->size) >> PAGE_SHIFT;
   356		unsigned long i;
   357	
   358		for (i = 0; i < pages; i++)
   359			__free_page(page + i);
   360		sg_free_table(table);
   361		kfree(table);
   362	}
   363	
   364	static struct ion_heap_ops kmalloc_ops = {
   365		.allocate = ion_system_contig_heap_allocate,
   366		.free = ion_system_contig_heap_free,
   367		.map_kernel = ion_heap_map_kernel,
   368		.unmap_kernel = ion_heap_unmap_kernel,
   369		.map_user = ion_heap_map_user,
   370	};
   371	
   372	static struct ion_heap *__ion_system_contig_heap_create(void)
   373	{
   374		struct ion_heap *heap;
   375	
   376		heap = kzalloc(sizeof(*heap), GFP_KERNEL);
   377		if (!heap)
   378			return ERR_PTR(-ENOMEM);
   379		heap->ops = &kmalloc_ops;
   380		heap->type = ION_HEAP_TYPE_SYSTEM_CONTIG;
   381		heap->name = "ion_system_contig_heap";
   382		return heap;
   383	}
   384	
 > 385	int ion_system_contig_heap_create(void)
   386	{
   387		struct ion_heap *heap;
   388	
   389		heap = __ion_system_contig_heap_create();
   390		if (IS_ERR(heap))
   391			return PTR_ERR(heap);
   392	
   393		ion_device_add_heap(heap);
   394		return 0;
   395	}
   396	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-18 12:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 12:59 [android-common:android-4.19 1/4] drivers/staging/android/ion/ion_system_heap.c:292:5: warning: no previous prototype for function 'ion_system_heap_create' kernel test robot

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.