* Re: [PATCH] staging: vc04_services: make a couple of functions static
2022-01-31 7:10 [PATCH] staging: vc04_services: make a couple of functions static Nguyen Dinh Phi
@ 2022-01-31 10:35 ` kernel test robot
2022-01-31 11:16 ` kernel test robot
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-31 10:35 UTC (permalink / raw)
To: Nguyen Dinh Phi, Nicolas Saenz Julienne, Greg Kroah-Hartman
Cc: kbuild-all, Nguyen Dinh Phi, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel
Hi Nguyen,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Nguyen-Dinh-Phi/staging-vc04_services-make-a-couple-of-functions-static/20220131-151209
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 64b2d6ffff862c0e7278198b4229e42e1abb3bb1
config: x86_64-buildonly-randconfig-r004-20220131 (https://download.01.org/0day-ci/archive/20220131/202201311820.inNbCM0H-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/1b64825a2b5b3312ae309c1714239df049b018ac
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nguyen-Dinh-Phi/staging-vc04_services-make-a-couple-of-functions-static/20220131-151209
git checkout 1b64825a2b5b3312ae309c1714239df049b018ac
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/staging/vc04_services/
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 >>):
In file included from include/linux/string.h:253,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
In function 'memcpy',
inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:434:4,
inlined from 'vchiq_complete_bulk' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:650:3:
>> include/linux/fortify-string.h:41:29: warning: argument 2 null where non-null expected [-Wnonnull]
41 | #define __underlying_memcpy __builtin_memcpy
| ^
include/linux/fortify-string.h:225:9: note: in expansion of macro '__underlying_memcpy'
225 | return __underlying_memcpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c: In function 'vchiq_complete_bulk':
include/linux/fortify-string.h:41:29: note: in a call to built-in function '__builtin_memcpy'
41 | #define __underlying_memcpy __builtin_memcpy
| ^
include/linux/fortify-string.h:225:9: note: in expansion of macro '__underlying_memcpy'
225 | return __underlying_memcpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~
vim +41 include/linux/fortify-string.h
3009f891bb9f32 Kees Cook 2021-08-02 26
a28a6e860c6cf2 Francis Laniel 2021-02-25 27 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
a28a6e860c6cf2 Francis Laniel 2021-02-25 28 extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
a28a6e860c6cf2 Francis Laniel 2021-02-25 29 extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
a28a6e860c6cf2 Francis Laniel 2021-02-25 30 extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 31 extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
a28a6e860c6cf2 Francis Laniel 2021-02-25 32 extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
a28a6e860c6cf2 Francis Laniel 2021-02-25 33 extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 34 extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 35 extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
a28a6e860c6cf2 Francis Laniel 2021-02-25 36 extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 37 extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 38 #else
a28a6e860c6cf2 Francis Laniel 2021-02-25 39 #define __underlying_memchr __builtin_memchr
a28a6e860c6cf2 Francis Laniel 2021-02-25 40 #define __underlying_memcmp __builtin_memcmp
a28a6e860c6cf2 Francis Laniel 2021-02-25 @41 #define __underlying_memcpy __builtin_memcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 42 #define __underlying_memmove __builtin_memmove
a28a6e860c6cf2 Francis Laniel 2021-02-25 43 #define __underlying_memset __builtin_memset
a28a6e860c6cf2 Francis Laniel 2021-02-25 44 #define __underlying_strcat __builtin_strcat
a28a6e860c6cf2 Francis Laniel 2021-02-25 45 #define __underlying_strcpy __builtin_strcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 46 #define __underlying_strlen __builtin_strlen
a28a6e860c6cf2 Francis Laniel 2021-02-25 47 #define __underlying_strncat __builtin_strncat
a28a6e860c6cf2 Francis Laniel 2021-02-25 48 #define __underlying_strncpy __builtin_strncpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 49 #endif
a28a6e860c6cf2 Francis Laniel 2021-02-25 50
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: vc04_services: make a couple of functions static
2022-01-31 7:10 [PATCH] staging: vc04_services: make a couple of functions static Nguyen Dinh Phi
2022-01-31 10:35 ` kernel test robot
@ 2022-01-31 11:16 ` kernel test robot
2022-01-31 13:07 ` Greg Kroah-Hartman
1 sibling, 1 reply; 5+ messages in thread
From: kernel test robot @ 2022-01-31 11:16 UTC (permalink / raw)
To: Nguyen Dinh Phi, Nicolas Saenz Julienne, Greg Kroah-Hartman
Cc: kbuild-all, Nguyen Dinh Phi, bcm-kernel-feedback-list,
linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel
Hi Nguyen,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/0day-ci/linux/commits/Nguyen-Dinh-Phi/staging-vc04_services-make-a-couple-of-functions-static/20220131-151209
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 64b2d6ffff862c0e7278198b4229e42e1abb3bb1
config: arm-randconfig-r002-20220130 (https://download.01.org/0day-ci/archive/20220131/202201311901.HT4PtVja-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/1b64825a2b5b3312ae309c1714239df049b018ac
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nguyen-Dinh-Phi/staging-vc04_services-make-a-couple-of-functions-static/20220131-151209
git checkout 1b64825a2b5b3312ae309c1714239df049b018ac
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/staging/vc04_services/
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/vc04_services/interface/vchiq_arm/vchiq_arm.c: In function 'free_pagelist':
>> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:434:25: warning: argument 2 null where non-null expected [-Wnonnull]
434 | memcpy((char *)kmap(pages[0]) +
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435 | pagelist->offset,
| ~~~~~~~~~~~~~~~~~
436 | fragments,
| ~~~~~~~~~~
437 | head_bytes);
| ~~~~~~~~~~~
In file included from include/linux/string.h:20,
from include/linux/bitmap.h:11,
from include/linux/cpumask.h:12,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/module.h:14,
from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
arch/arm/include/asm/string.h:20:15: note: in a call to function 'memcpy' declared 'nonnull'
20 | extern void * memcpy(void *, const void *, __kernel_size_t);
| ^~~~~~
vim +434 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 398
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 399 static void
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 400 free_pagelist(struct vchiq_pagelist_info *pagelistinfo,
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 401 int actual)
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 402 {
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 403 struct pagelist *pagelist = pagelistinfo->pagelist;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 404 struct page **pages = pagelistinfo->pages;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 405 unsigned int num_pages = pagelistinfo->num_pages;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 406
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 407 vchiq_log_trace(vchiq_arm_log_level, "%s - %pK, %d",
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 408 __func__, pagelistinfo->pagelist, actual);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 409
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 410 /*
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 411 * NOTE: dma_unmap_sg must be called before the
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 412 * cpu can touch any of the data/pages.
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 413 */
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 414 dma_unmap_sg(g_dev, pagelistinfo->scatterlist,
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 415 pagelistinfo->num_pages, pagelistinfo->dma_dir);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 416 pagelistinfo->scatterlist_mapped = 0;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 417
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 418 /* Deal with any partial cache lines (fragments) */
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 419 if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) {
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 420 char *fragments = g_fragments_base +
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 421 (pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) *
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 422 g_fragments_size;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 423 int head_bytes, tail_bytes;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 424
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 425 head_bytes = (g_cache_line_size - pagelist->offset) &
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 426 (g_cache_line_size - 1);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 427 tail_bytes = (pagelist->offset + actual) &
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 428 (g_cache_line_size - 1);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 429
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 430 if ((actual >= 0) && (head_bytes != 0)) {
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 431 if (head_bytes > actual)
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 432 head_bytes = actual;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 433
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 @434 memcpy((char *)kmap(pages[0]) +
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 435 pagelist->offset,
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 436 fragments,
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 437 head_bytes);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 438 kunmap(pages[0]);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 439 }
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 440 if ((actual >= 0) && (head_bytes < actual) &&
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 441 (tail_bytes != 0)) {
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 442 memcpy((char *)kmap(pages[num_pages - 1]) +
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 443 ((pagelist->offset + actual) &
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 444 (PAGE_SIZE - 1) & ~(g_cache_line_size - 1)),
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 445 fragments + g_cache_line_size,
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 446 tail_bytes);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 447 kunmap(pages[num_pages - 1]);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 448 }
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 449
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 450 down(&g_free_fragments_mutex);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 451 *(char **)fragments = g_free_fragments;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 452 g_free_fragments = fragments;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 453 up(&g_free_fragments_mutex);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 454 up(&g_free_fragments_sema);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 455 }
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 456
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 457 /* Need to mark all the pages dirty. */
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 458 if (pagelist->type != PAGELIST_WRITE &&
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 459 pagelistinfo->pages_need_release) {
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 460 unsigned int i;
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 461
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 462 for (i = 0; i < num_pages; i++)
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 463 set_page_dirty(pages[i]);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 464 }
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 465
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 466 cleanup_pagelistinfo(pagelistinfo);
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 467 }
7b9148dcb74a00 Ojaswin Mujoo 2021-07-21 468
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 5+ messages in thread