[PATCH] staging: wfx: refactor to avoid duplication at hif_tx.c

kernel test robot lkp at intel.com
Wed Aug 5 11:24:44 UTC 2020


Hi Tomer,

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/Tomer-Samara/staging-wfx-refactor-to-avoid-duplication-at-hif_tx-c/20200805-165649
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 5bbd90550da8f7bdac769b5825597e67183c9411
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:25,
                    from arch/m68k/include/asm/io.h:8,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/staging/wfx/hif_tx.c:9:
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
   arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      83 |  ({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \
         |       ^~~
   arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
     430 |   rom_out_8(port, *buf++);
         |   ^~~~~~~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
   arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      86 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
         |        ^~~
   arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 'rom_out_be16'
     448 |   rom_out_be16(port, *buf++);
         |   ^~~~~~~~~~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
   arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
      90 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
         |        ^~~
   arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
     466 |   rom_out_le16(port, *buf++);
         |   ^~~~~~~~~~~~
   In file included from include/linux/kernel.h:11,
                    from include/linux/skbuff.h:13,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/staging/wfx/hif_tx.c:9:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/skbuff.h:15,
                    from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from drivers/staging/wfx/hif_tx.c:9:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
     144 |  int __ret_warn_once = !!(condition);   \
         |                           ^~~~~~~~~
   arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
     170 | #define pfn_valid(pfn)  virt_addr_valid(pfn_to_virt(pfn))
         |                         ^~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
     352 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
         |                   ^~~~~~~~~
   drivers/staging/wfx/hif_tx.c: At top level:
>> drivers/staging/wfx/hif_tx.c:126:5: warning: no previous prototype for 'wfx_full_send' [-Wmissing-prototypes]
     126 | int wfx_full_send(struct wfx_dev *wdev, struct hif_msg *hif, void *reply, size_t reply_len,
         |     ^~~~~~~~~~~~~
>> drivers/staging/wfx/hif_tx.c:133:5: warning: no previous prototype for 'wfx_full_send_no_reply_async' [-Wmissing-prototypes]
     133 | int wfx_full_send_no_reply_async(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/wfx/hif_tx.c:139:5: warning: no previous prototype for 'wfx_full_send_no_reply' [-Wmissing-prototypes]
     139 | int wfx_full_send_no_reply(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/wfx/hif_tx.c:145:5: warning: no previous prototype for 'wfx_full_send_no_reply_free' [-Wmissing-prototypes]
     145 | int wfx_full_send_no_reply_free(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/wfx_full_send +126 drivers/staging/wfx/hif_tx.c

   125	
 > 126	int wfx_full_send(struct wfx_dev *wdev, struct hif_msg *hif, void *reply, size_t reply_len,
   127			  bool async, int if_id, unsigned int cmd, int size)
   128	{
   129		wfx_fill_header(hif, if_id, cmd, size);
   130		return wfx_cmd_send(wdev, hif, reply, reply_len, async);
   131	}
   132	
 > 133	int wfx_full_send_no_reply_async(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
   134					 unsigned int cmd, int size, bool async)
   135	{
   136		return wfx_full_send(wdev, hif, NULL, 0, async, if_id, cmd, size);
   137	}
   138	
 > 139	int wfx_full_send_no_reply(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
   140				   unsigned int cmd, int size)
   141	{
   142		return wfx_full_send_no_reply_async(wdev, hif, if_id, cmd, size, false);
   143	}
   144	
 > 145	int wfx_full_send_no_reply_free(struct wfx_dev *wdev, struct hif_msg *hif, int if_id,
   146					unsigned int cmd, int size)
   147	{
   148		int ret;
   149	
   150		ret = wfx_full_send_no_reply(wdev, hif, if_id, cmd, size);
   151		kfree(hif);
   152		return ret;
   153	}
   154	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 57295 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20200805/54e45120/attachment-0001.bin>


More information about the devel mailing list