Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Benjamin Berg <benjamin.berg@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	0day robot <lkp@intel.com>,
	Miri Korenblit <miriam.rachel.korenblit@intel.com>
Subject: drivers/net/wireless/virtual/mac80211_hwsim_nan.c:97:12: warning: address of array 'conf->cluster_id' will always evaluate to 'true'
Date: Thu, 30 Apr 2026 07:07:59 +0200	[thread overview]
Message-ID: <202604300631.LcjE8F8k-lkp@intel.com> (raw)

tree:   https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-mac80211-track-the-id-of-the-NAN-cluster-we-joined/20260430-070259
head:   e0435b199cd58dfc68f8fdfe1fe2bcec997c731c
commit: be631fda189889f9d902d39905c931f3a8364bf3 wifi: mac80211_hwsim: split NAN handling into separate file
date:   6 hours ago
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260430/202604300631.LcjE8F8k-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300631.LcjE8F8k-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/202604300631.LcjE8F8k-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/virtual/mac80211_hwsim_nan.c:97:12: warning: address of array 'conf->cluster_id' will always evaluate to 'true' [-Wpointer-bool-conversion]
      97 |         if (conf->cluster_id && !is_zero_ether_addr(conf->cluster_id) &&
         |             ~~~~~~^~~~~~~~~~ ~~
   1 warning generated.


vim +97 drivers/net/wireless/virtual/mac80211_hwsim_nan.c

    68	
    69	int mac80211_hwsim_nan_start(struct ieee80211_hw *hw,
    70				     struct ieee80211_vif *vif,
    71				     struct cfg80211_nan_conf *conf)
    72	{
    73		struct mac80211_hwsim_data *data = hw->priv;
    74		u64 tsf = mac80211_hwsim_get_tsf(hw, NULL);
    75		u32 dw_int = 512 * 1000;
    76		u64 until_dw = dw_int - do_div(tsf, dw_int);
    77		struct wireless_dev *wdev = ieee80211_vif_to_wdev(vif);
    78	
    79		if (vif->type != NL80211_IFTYPE_NAN)
    80			return -EINVAL;
    81	
    82		if (data->nan.device_vif)
    83			return -EALREADY;
    84	
    85		/* set this before starting the timer, as preemption might occur */
    86		data->nan.device_vif = vif;
    87		data->nan.bands = conf->bands;
    88		data->nan.curr_dw_band = NL80211_BAND_2GHZ;
    89	
    90		wiphy_debug(hw->wiphy, "nan_started, next_dw=%llu\n",
    91			    until_dw);
    92	
    93		hrtimer_start(&data->nan.timer,
    94			      ns_to_ktime(until_dw * NSEC_PER_USEC),
    95			      HRTIMER_MODE_REL_SOFT);
    96	
  > 97		if (conf->cluster_id && !is_zero_ether_addr(conf->cluster_id) &&
    98		    is_zero_ether_addr(hwsim_nan_cluster_id)) {
    99			memcpy(hwsim_nan_cluster_id, conf->cluster_id, ETH_ALEN);
   100		} else if (is_zero_ether_addr(hwsim_nan_cluster_id)) {
   101			hwsim_nan_cluster_id[0] = 0x50;
   102			hwsim_nan_cluster_id[1] = 0x6f;
   103			hwsim_nan_cluster_id[2] = 0x9a;
   104			hwsim_nan_cluster_id[3] = 0x01;
   105			hwsim_nan_cluster_id[4] = get_random_u8();
   106			hwsim_nan_cluster_id[5] = get_random_u8();
   107		}
   108	
   109		data->nan.notify_dw = conf->enable_dw_notification;
   110	
   111		cfg80211_nan_cluster_joined(wdev, hwsim_nan_cluster_id, true,
   112					    GFP_KERNEL);
   113	
   114		return 0;
   115	}
   116	

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

                 reply	other threads:[~2026-04-30  5:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202604300631.LcjE8F8k-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=benjamin.berg@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox