mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"open list:NETRONOME ETHERNET DRIVERS" <oss-drivers@corigine.com>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org,
	Qianfeng Rong <rongqianfeng@vivo.com>
Subject: Re: [PATCH v2 2/3] nfp: flower: use vmalloc_array() to simplify code
Date: Sat, 16 Aug 2025 13:58:05 +0800	[thread overview]
Message-ID: <202508161307.IWBBnNXY-lkp@intel.com> (raw)
In-Reply-To: <20250814102100.151942-3-rongqianfeng@vivo.com>

Hi Qianfeng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tnguy-next-queue/dev-queue]
[also build test WARNING on tnguy-net-queue/dev-queue net-next/main net/main linus/master v6.17-rc1 next-20250815]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Qianfeng-Rong/eth-intel-use-vmalloc_array-to-simplify-code/20250814-183400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20250814102100.151942-3-rongqianfeng%40vivo.com
patch subject: [PATCH v2 2/3] nfp: flower: use vmalloc_array() to simplify code
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250816/202508161307.IWBBnNXY-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250816/202508161307.IWBBnNXY-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508161307.IWBBnNXY-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/vmalloc.h:5,
                    from drivers/net/ethernet/netronome/nfp/flower/metadata.c:8:
   drivers/net/ethernet/netronome/nfp/flower/metadata.c: In function 'nfp_flower_metadata_init':
>> include/linux/stddef.h:24:42: warning: 'vmalloc_array_noprof' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:239:16: note: in definition of macro 'alloc_hooks_tag'
     239 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:24:42: note: earlier argument should specify number of elements, later size of each element
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:239:16: note: in definition of macro 'alloc_hooks_tag'
     239 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:24:42: warning: 'vmalloc_array_noprof' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:243:24: note: in definition of macro 'alloc_hooks_tag'
     243 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:24:42: note: earlier argument should specify number of elements, later size of each element
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:243:24: note: in definition of macro 'alloc_hooks_tag'
     243 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~
>> include/linux/stddef.h:24:42: warning: 'vmalloc_array_noprof' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:246:24: note: in definition of macro 'alloc_hooks_tag'
     246 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:24:42: note: earlier argument should specify number of elements, later size of each element
      24 | #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
         |                                          ^
   include/linux/alloc_tag.h:246:24: note: in definition of macro 'alloc_hooks_tag'
     246 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/vmalloc.h:192:33: note: in expansion of macro 'alloc_hooks'
     192 | #define vmalloc_array(...)      alloc_hooks(vmalloc_array_noprof(__VA_ARGS__))
         |                                 ^~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:17: note: in expansion of macro 'vmalloc_array'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                 ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/main.h:29:41: note: in expansion of macro 'sizeof_field'
      29 | #define NFP_FL_STATS_ELEM_RS            sizeof_field(struct nfp_fl_stats_id, \
         |                                         ^~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/flower/metadata.c:567:31: note: in expansion of macro 'NFP_FL_STATS_ELEM_RS'
     567 |                 vmalloc_array(NFP_FL_STATS_ELEM_RS,
         |                               ^~~~~~~~~~~~~~~~~~~~


vim +24 include/linux/stddef.h

3876488444e712 Denys Vlasenko 2015-03-09  17  
4229a470175be1 Kees Cook      2018-01-10  18  /**
e7f18c22e6bea2 Kees Cook      2021-08-19  19   * sizeof_field() - Report the size of a struct field in bytes
4229a470175be1 Kees Cook      2018-01-10  20   *
4229a470175be1 Kees Cook      2018-01-10  21   * @TYPE: The structure containing the field of interest
4229a470175be1 Kees Cook      2018-01-10  22   * @MEMBER: The field to return the size of
4229a470175be1 Kees Cook      2018-01-10  23   */
4229a470175be1 Kees Cook      2018-01-10 @24  #define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
4229a470175be1 Kees Cook      2018-01-10  25  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-08-16  5:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 10:20 [PATCH v2 0/3] net: " Qianfeng Rong
2025-08-14 10:20 ` [PATCH v2 1/3] eth: intel: " Qianfeng Rong
2025-08-14 10:20 ` [PATCH v2 2/3] nfp: flower: " Qianfeng Rong
2025-08-15 17:50   ` Jakub Kicinski
2025-08-16  7:35     ` Qianfeng Rong
2025-08-16  5:58   ` kernel test robot [this message]
2025-08-14 10:20 ` [PATCH v2 3/3] ppp: " Qianfeng Rong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202508161307.IWBBnNXY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    --cc=rongqianfeng@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®