All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
@ 2020-06-23  5:56 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-06-23  5:56 UTC (permalink / raw)
  To: Jérôme Pouiller; +Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd0d718152e4c65b173070d48ea9dfc06894c3e5
commit: 652b4afb240e5dc196995597942309e89e89c767 staging: wfx: load firmware
date:   9 months ago
config: xtensa-randconfig-m031-20200623 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0

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/wfx/fwio.c:83:5: warning: no previous prototype for 'sram_write_dma_safe' [-Wmissing-prototypes]
      83 | int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
         |     ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/firmware.h:6,
                    from drivers/staging/wfx/fwio.c:8:
   drivers/staging/wfx/fwio.c: In function 'sram_write_dma_safe':
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
      69 |  (cond) ?     \
         |   ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
      69 |  (cond) ?     \
         |   ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   drivers/staging/wfx/fwio.c: At top level:
   drivers/staging/wfx/fwio.c:101:5: warning: no previous prototype for 'get_firmware' [-Wmissing-prototypes]
     101 | int get_firmware(struct wfx_dev *wdev, u32 keyset_chip,
         |     ^~~~~~~~~~~~
   drivers/staging/wfx/fwio.c:229:5: warning: no previous prototype for 'load_firmware_secure' [-Wmissing-prototypes]
     229 | int load_firmware_secure(struct wfx_dev *wdev)
         |     ^~~~~~~~~~~~~~~~~~~~

vim +/if +88 drivers/staging/wfx/fwio.c

    71	
    72	/*
    73	 * request_firmware() allocate data using vmalloc(). It is not compatible with
    74	 * underlying hardware that use DMA. Function below detect this case and
    75	 * allocate a bounce buffer if necessary.
    76	 *
    77	 * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to
    78	 * detect this problem at runtime  (else, kernel silently fail).
    79	 *
    80	 * NOTE: it may also be possible to use 'pages' from struct firmware and avoid
    81	 * bounce buffer
    82	 */
    83	int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
    84	{
    85		int ret;
    86		const u8 *tmp;
    87	
  > 88		if (!virt_addr_valid(buf)) {
    89			tmp = kmemdup(buf, len, GFP_KERNEL);
    90			if (!tmp)
    91				return -ENOMEM;
    92		} else {
    93			tmp = buf;
    94		}
    95		ret = sram_buf_write(wdev, addr, tmp, len);
    96		if (!virt_addr_valid(buf))
    97			kfree(tmp);
    98		return ret;
    99	}
   100	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
@ 2020-06-23  5:56 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-06-23  5:56 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd0d718152e4c65b173070d48ea9dfc06894c3e5
commit: 652b4afb240e5dc196995597942309e89e89c767 staging: wfx: load firmware
date:   9 months ago
config: xtensa-randconfig-m031-20200623 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0

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/wfx/fwio.c:83:5: warning: no previous prototype for 'sram_write_dma_safe' [-Wmissing-prototypes]
      83 | int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
         |     ^~~~~~~~~~~~~~~~~~~
   In file included from include/linux/firmware.h:6,
                    from drivers/staging/wfx/fwio.c:8:
   drivers/staging/wfx/fwio.c: In function 'sram_write_dma_safe':
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
      69 |  (cond) ?     \
         |   ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
>> drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'
      88 |  if (!virt_addr_valid(buf)) {
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:88:7: note: in expansion of macro 'virt_addr_valid'
      88 |  if (!virt_addr_valid(buf)) {
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
      69 |  (cond) ?     \
         |   ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   drivers/staging/wfx/fwio.c:96:2: note: in expansion of macro 'if'
      96 |  if (!virt_addr_valid(buf))
         |  ^~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   drivers/staging/wfx/fwio.c:96:7: note: in expansion of macro 'virt_addr_valid'
      96 |  if (!virt_addr_valid(buf))
         |       ^~~~~~~~~~~~~~~
   drivers/staging/wfx/fwio.c: At top level:
   drivers/staging/wfx/fwio.c:101:5: warning: no previous prototype for 'get_firmware' [-Wmissing-prototypes]
     101 | int get_firmware(struct wfx_dev *wdev, u32 keyset_chip,
         |     ^~~~~~~~~~~~
   drivers/staging/wfx/fwio.c:229:5: warning: no previous prototype for 'load_firmware_secure' [-Wmissing-prototypes]
     229 | int load_firmware_secure(struct wfx_dev *wdev)
         |     ^~~~~~~~~~~~~~~~~~~~

vim +/if +88 drivers/staging/wfx/fwio.c

    71	
    72	/*
    73	 * request_firmware() allocate data using vmalloc(). It is not compatible with
    74	 * underlying hardware that use DMA. Function below detect this case and
    75	 * allocate a bounce buffer if necessary.
    76	 *
    77	 * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to
    78	 * detect this problem at runtime  (else, kernel silently fail).
    79	 *
    80	 * NOTE: it may also be possible to use 'pages' from struct firmware and avoid
    81	 * bounce buffer
    82	 */
    83	int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
    84	{
    85		int ret;
    86		const u8 *tmp;
    87	
  > 88		if (!virt_addr_valid(buf)) {
    89			tmp = kmemdup(buf, len, GFP_KERNEL);
    90			if (!tmp)
    91				return -ENOMEM;
    92		} else {
    93			tmp = buf;
    94		}
    95		ret = sram_buf_write(wdev, addr, tmp, len);
    96		if (!virt_addr_valid(buf))
    97			kfree(tmp);
    98		return ret;
    99	}
   100	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-23  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23  5:56 drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if' kernel test robot
2020-06-23  5:56 ` 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.