public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
@ 2020-06-17  8:52 kernel test robot
  2020-06-17 12:07 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-06-17  8:52 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: kbuild-all, linux-kernel, Jason Gunthorpe, Mark Zhang

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   69119673bd50b176ded34032fadd41530fb5af21
commit: e383085c24255821e79d3c2aa6302d804b6a1c48 RDMA/mlx5: Set ECE options during QP create
date:   3 weeks ago
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        git checkout e383085c24255821e79d3c2aa6302d804b6a1c48
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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 >>, old ones prefixed by <<):

In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/infiniband/hw/mlx5/qp.c:33:
drivers/infiniband/hw/mlx5/qp.c: In function 'check_ucmd_data':
>> drivers/infiniband/hw/mlx5/mlx5_ib.h:56:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |                               ^~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 |   func(&id, ##__VA_ARGS__);           |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,            |  ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|  ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|                       ^~~~~~~
>> drivers/infiniband/hw/mlx5/mlx5_ib.h:56:2: note: in expansion of macro 'dev_dbg'
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |  ^~~~~~~
>> drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
2904 |   mlx5_ib_dbg(
|   ^~~~~~~~~~~
drivers/infiniband/hw/mlx5/qp.c:2906:37: note: format string is defined here
2906 |    "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lun",
|                                   ~~^
|                                     |
|                                     long unsigned int
|                                   %u
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/infiniband/hw/mlx5/qp.c:33:
drivers/infiniband/hw/mlx5/mlx5_ib.h:56:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |                               ^~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 |   func(&id, ##__VA_ARGS__);           |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,            |  ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|  ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|                       ^~~~~~~
>> drivers/infiniband/hw/mlx5/mlx5_ib.h:56:2: note: in expansion of macro 'dev_dbg'
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |  ^~~~~~~
>> drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
2904 |   mlx5_ib_dbg(
|   ^~~~~~~~~~~
drivers/infiniband/hw/mlx5/qp.c:2906:49: note: format string is defined here
2906 |    "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lun",
|                                               ~~^
|                                                 |
|                                                 long unsigned int
|                                               %u
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/infiniband/hw/mlx5/qp.c:33:
drivers/infiniband/hw/mlx5/mlx5_ib.h:56:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 9 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |                               ^~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 |   func(&id, ##__VA_ARGS__);           |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,            |  ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|  ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|                       ^~~~~~~
>> drivers/infiniband/hw/mlx5/mlx5_ib.h:56:2: note: in expansion of macro 'dev_dbg'
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |  ^~~~~~~
>> drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
2904 |   mlx5_ib_dbg(
|   ^~~~~~~~~~~
drivers/infiniband/hw/mlx5/qp.c:2906:61: note: format string is defined here
2906 |    "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lun",
|                                                           ~~^
|                                                             |
|                                                             long unsigned int
|                                                           %u
In file included from include/linux/printk.h:326,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/infiniband/hw/mlx5/qp.c:33:
drivers/infiniband/hw/mlx5/mlx5_ib.h:56:31: warning: format '%lu' expects argument of type 'long unsigned int', but argument 10 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |                               ^~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:125:15: note: in definition of macro '__dynamic_func_call'
125 |   func(&id, ##__VA_ARGS__);           |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
157 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,            |  ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:2: note: in expansion of macro 'dynamic_dev_dbg'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|  ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:114:23: note: in expansion of macro 'dev_fmt'
114 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
|                       ^~~~~~~
>> drivers/infiniband/hw/mlx5/mlx5_ib.h:56:2: note: in expansion of macro 'dev_dbg'
56 |  dev_dbg(&(_dev)->ib_dev.dev, "%s:%d:(pid %d): " format, __func__,               |  ^~~~~~~
>> drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
2904 |   mlx5_ib_dbg(
|   ^~~~~~~~~~~
drivers/infiniband/hw/mlx5/qp.c:2906:73: note: format string is defined here
2906 |    "udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lun",
|                                                                       ~~^
|                                                                         |
|                                                                         long unsigned int
|                                                                       %u

vim +/mlx5_ib_dbg +2904 drivers/infiniband/hw/mlx5/qp.c

  2867	
  2868	static int check_ucmd_data(struct mlx5_ib_dev *dev,
  2869				   struct mlx5_create_qp_params *params)
  2870	{
  2871		struct ib_qp_init_attr *attr = params->attr;
  2872		struct ib_udata *udata = params->udata;
  2873		size_t size, last;
  2874		int ret;
  2875	
  2876		if (params->is_rss_raw)
  2877			/*
  2878			 * These QPs don't have "reserved" field in their
  2879			 * create_qp input struct, so their data is always valid.
  2880			 */
  2881			last = sizeof(struct mlx5_ib_create_qp_rss);
  2882		else
  2883			/* IB_QPT_RAW_PACKET and IB_QPT_DRIVER don't have ECE data */
  2884			switch (attr->qp_type) {
  2885			case IB_QPT_DRIVER:
  2886			case IB_QPT_RAW_PACKET:
  2887				last = offsetof(struct mlx5_ib_create_qp, ece_options);
  2888				break;
  2889			default:
  2890				last = offsetof(struct mlx5_ib_create_qp, reserved);
  2891			}
  2892	
  2893		if (udata->inlen <= last)
  2894			return 0;
  2895	
  2896		/*
  2897		 * User provides different create_qp structures based on the
  2898		 * flow and we need to know if he cleared memory after our
  2899		 * struct create_qp ends.
  2900		 */
  2901		size = udata->inlen - last;
  2902		ret = ib_is_udata_cleared(params->udata, last, size);
  2903		if (!ret)
> 2904			mlx5_ib_dbg(
  2905				dev,
  2906				"udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lu\n",
  2907				udata->inlen, params->ucmd_size, last, size);
  2908		return ret ? 0 : -EINVAL;
  2909	}
  2910	

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

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

* Re: drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg'
  2020-06-17  8:52 drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg' kernel test robot
@ 2020-06-17 12:07 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-06-17 12:07 UTC (permalink / raw)
  To: kernel test robot; +Cc: Leon Romanovsky, kbuild-all, linux-kernel, Mark Zhang

On Wed, Jun 17, 2020 at 04:52:02PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   69119673bd50b176ded34032fadd41530fb5af21
> commit: e383085c24255821e79d3c2aa6302d804b6a1c48 RDMA/mlx5: Set ECE options during QP create
> date:   3 weeks ago
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
> reproduce (this is a W=1 build):
>         git checkout e383085c24255821e79d3c2aa6302d804b6a1c48
>         # save the attached .config to linux build tree
>         make W=1 ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>

I think this should be fixed by:

commit 4f5747cf8e5947479a27a3597829e45d6d8d73e0
Author: Tom Seewald <tseewald@gmail.com>
Date:   Thu Jun 4 21:30:12 2020 -0500

    RDMA/mlx5: Fix -Wformat warning in check_ucmd_data()
    
    Variables of type size_t should use %zu rather than %lu [1]. The variables
    "inlen", "ucmd", "last", and "size" are all size_t, so use the correct
    format specifiers.
    
    [1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html
    
    Fixes: e383085c2425 ("RDMA/mlx5: Set ECE options during QP create")
    Link: https://lore.kernel.org/r/20200605023012.9527-1-tseewald@gmail.com
    Signed-off-by: Tom Seewald <tseewald@gmail.com>
    Acked-by: Leon Romanovsky <leonro@mellanox.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>


Jason

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

end of thread, other threads:[~2020-06-17 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-17  8:52 drivers/infiniband/hw/mlx5/qp.c:2904:3: note: in expansion of macro 'mlx5_ib_dbg' kernel test robot
2020-06-17 12:07 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox