All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, 0day robot <lkp@intel.com>
Subject: drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
Date: Fri, 28 Jan 2022 23:35:00 +0800	[thread overview]
Message-ID: <202201282320.hBOR8EK6-lkp@intel.com> (raw)

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20220128-173237/cgel-zte-gmail-com/dvm-use-struct_size-over-open-coded-arithmetic/20220128-160349
head:   77680691120f395e319c3d051219912dd305048a
commit: 77680691120f395e319c3d051219912dd305048a iwlwifi: dvm: use struct_size over open coded arithmetic
date:   6 hours ago
config: riscv-buildonly-randconfig-r005-20220124 (https://download.01.org/0day-ci/archive/20220128/202201282320.hBOR8EK6-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/77680691120f395e319c3d051219912dd305048a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20220128-173237/cgel-zte-gmail-com/dvm-use-struct_size-over-open-coded-arithmetic/20220128-160349
        git checkout 77680691120f395e319c3d051219912dd305048a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/net/wireless/intel/iwlwifi/dvm/

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

All errors (new ones prefixed by >>):

>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:18: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                               ~~~^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: indirection requires pointer operand ('u8[]' (aka 'unsigned char[]') invalid)
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:14: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                              ^~~~~~~~~~~~
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:49: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:258:59: note: expanded from macro '__must_be_array'
   #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compiler_types.h:287:63: note: expanded from macro '__same_type'
   #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
                                                                 ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
                                                                ^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:49: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:258:65: note: expanded from macro '__must_be_array'
   #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   include/linux/compiler_types.h:287:74: note: expanded from macro '__same_type'
   #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
                                                                            ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
                                                                ^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: indirection requires pointer operand ('struct iwl_wipan_noa_data' invalid)
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:195:14: note: expanded from macro 'struct_size'
                       sizeof(*(p)))
                              ^~~~
   5 errors generated.


vim +918 drivers/net/wireless/intel/iwlwifi/dvm/rx.c

   897	
   898	static void iwlagn_rx_noa_notification(struct iwl_priv *priv,
   899					       struct iwl_rx_cmd_buffer *rxb)
   900	{
   901		struct iwl_wipan_noa_data *new_data, *old_data;
   902		struct iwl_rx_packet *pkt = rxb_addr(rxb);
   903		struct iwl_wipan_noa_notification *noa_notif = (void *)pkt->data;
   904	
   905		/* no condition -- we're in softirq */
   906		old_data = rcu_dereference_protected(priv->noa_data, true);
   907	
   908		if (noa_notif->noa_active) {
   909			u32 len = le16_to_cpu(noa_notif->noa_attribute.length);
   910			u32 copylen = len;
   911	
   912			/* EID, len, OUI, subtype */
   913			len += 1 + 1 + 3 + 1;
   914			/* P2P id, P2P length */
   915			len += 1 + 2;
   916			copylen += 1 + 2;
   917	
 > 918			new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
   919			if (new_data) {
   920				new_data->length = len;
   921				new_data->data[0] = WLAN_EID_VENDOR_SPECIFIC;
   922				new_data->data[1] = len - 2; /* not counting EID, len */
   923				new_data->data[2] = (WLAN_OUI_WFA >> 16) & 0xff;
   924				new_data->data[3] = (WLAN_OUI_WFA >> 8) & 0xff;
   925				new_data->data[4] = (WLAN_OUI_WFA >> 0) & 0xff;
   926				new_data->data[5] = WLAN_OUI_TYPE_WFA_P2P;
   927				memcpy(&new_data->data[6], &noa_notif->noa_attribute,
   928				       copylen);
   929			}
   930		} else
   931			new_data = NULL;
   932	
   933		rcu_assign_pointer(priv->noa_data, new_data);
   934	
   935		if (old_data)
   936			kfree_rcu(old_data, rcu_head);
   937	}
   938	

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
Date: Fri, 28 Jan 2022 23:35:00 +0800	[thread overview]
Message-ID: <202201282320.hBOR8EK6-lkp@intel.com> (raw)

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

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20220128-173237/cgel-zte-gmail-com/dvm-use-struct_size-over-open-coded-arithmetic/20220128-160349
head:   77680691120f395e319c3d051219912dd305048a
commit: 77680691120f395e319c3d051219912dd305048a iwlwifi: dvm: use struct_size over open coded arithmetic
date:   6 hours ago
config: riscv-buildonly-randconfig-r005-20220124 (https://download.01.org/0day-ci/archive/20220128/202201282320.hBOR8EK6-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 33b45ee44b1f32ffdbc995e6fec806271b4b3ba4)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/77680691120f395e319c3d051219912dd305048a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20220128-173237/cgel-zte-gmail-com/dvm-use-struct_size-over-open-coded-arithmetic/20220128-160349
        git checkout 77680691120f395e319c3d051219912dd305048a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/net/wireless/intel/iwlwifi/dvm/

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

All errors (new ones prefixed by >>):

>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:18: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                               ~~~^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: indirection requires pointer operand ('u8[]' (aka 'unsigned char[]') invalid)
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:14: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                              ^~~~~~~~~~~~
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:49: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:258:59: note: expanded from macro '__must_be_array'
   #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compiler_types.h:287:63: note: expanded from macro '__same_type'
   #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
                                                                 ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
                                                                ^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'?
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:194:49: note: expanded from macro 'struct_size'
                       sizeof(*(p)->member) + __must_be_array((p)->member),\
                                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:258:65: note: expanded from macro '__must_be_array'
   #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   include/linux/compiler_types.h:287:74: note: expanded from macro '__same_type'
   #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
                                                                            ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
   #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
                                                                ^
>> drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: indirection requires pointer operand ('struct iwl_wipan_noa_data' invalid)
                   new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:195:14: note: expanded from macro 'struct_size'
                       sizeof(*(p)))
                              ^~~~
   5 errors generated.


vim +918 drivers/net/wireless/intel/iwlwifi/dvm/rx.c

   897	
   898	static void iwlagn_rx_noa_notification(struct iwl_priv *priv,
   899					       struct iwl_rx_cmd_buffer *rxb)
   900	{
   901		struct iwl_wipan_noa_data *new_data, *old_data;
   902		struct iwl_rx_packet *pkt = rxb_addr(rxb);
   903		struct iwl_wipan_noa_notification *noa_notif = (void *)pkt->data;
   904	
   905		/* no condition -- we're in softirq */
   906		old_data = rcu_dereference_protected(priv->noa_data, true);
   907	
   908		if (noa_notif->noa_active) {
   909			u32 len = le16_to_cpu(noa_notif->noa_attribute.length);
   910			u32 copylen = len;
   911	
   912			/* EID, len, OUI, subtype */
   913			len += 1 + 1 + 3 + 1;
   914			/* P2P id, P2P length */
   915			len += 1 + 2;
   916			copylen += 1 + 2;
   917	
 > 918			new_data = kmalloc(struct_size(*new_data, data, len), GFP_ATOMIC);
   919			if (new_data) {
   920				new_data->length = len;
   921				new_data->data[0] = WLAN_EID_VENDOR_SPECIFIC;
   922				new_data->data[1] = len - 2; /* not counting EID, len */
   923				new_data->data[2] = (WLAN_OUI_WFA >> 16) & 0xff;
   924				new_data->data[3] = (WLAN_OUI_WFA >> 8) & 0xff;
   925				new_data->data[4] = (WLAN_OUI_WFA >> 0) & 0xff;
   926				new_data->data[5] = WLAN_OUI_TYPE_WFA_P2P;
   927				memcpy(&new_data->data[6], &noa_notif->noa_attribute,
   928				       copylen);
   929			}
   930		} else
   931			new_data = NULL;
   932	
   933		rcu_assign_pointer(priv->noa_data, new_data);
   934	
   935		if (old_data)
   936			kfree_rcu(old_data, rcu_head);
   937	}
   938	

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

             reply	other threads:[~2022-01-28 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 15:35 kernel test robot [this message]
2022-01-28 15:35 ` drivers/net/wireless/intel/iwlwifi/dvm/rx.c:918:22: error: member reference type 'struct iwl_wipan_noa_data' is not a pointer; did you mean to use '.'? kernel test robot

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=202201282320.hBOR8EK6-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /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 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.