lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202006231335.urptDQAp%lkp@intel.com>
Date:   Tue, 23 Jun 2020 13:56:38 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jérôme Pouiller <jerome.pouiller@...abs.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: drivers/staging/wfx/fwio.c:88:2: note: in expansion of macro 'if'

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@...el.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

Download attachment ".config.gz" of type "application/gzip" (29911 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ