Search Linux Wireless

[mac80211-next:master 3/3] net/wireless/scan.c:1436:28: warning: comparison between pointer and integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
head:   22c333414b7040e0a77c3d971c9580dc26f8f4d5
commit: 22c333414b7040e0a77c3d971c9580dc26f8f4d5 [3/3] cfg80211: remove support for adjacent channel compensation
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-5) 7.5.0
reproduce:
        git checkout 22c333414b7040e0a77c3d971c9580dc26f8f4d5
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   net/wireless/scan.c: In function 'cfg80211_inform_single_bss_data':
>> net/wireless/scan.c:1436:28: warning: comparison between pointer and integer
     signal_valid = data->chan == channel->center_freq;
                               ^~

vim +1436 net/wireless/scan.c

  1360	
  1361	/* Returned bss is reference counted and must be cleaned up appropriately. */
  1362	static struct cfg80211_bss *
  1363	cfg80211_inform_single_bss_data(struct wiphy *wiphy,
  1364					struct cfg80211_inform_bss *data,
  1365					enum cfg80211_bss_frame_type ftype,
  1366					const u8 *bssid, u64 tsf, u16 capability,
  1367					u16 beacon_interval, const u8 *ie, size_t ielen,
  1368					struct cfg80211_non_tx_bss *non_tx_data,
  1369					gfp_t gfp)
  1370	{
  1371		struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
  1372		struct cfg80211_bss_ies *ies;
  1373		struct ieee80211_channel *channel;
  1374		struct cfg80211_internal_bss tmp = {}, *res;
  1375		int bss_type;
  1376		bool signal_valid;
  1377		unsigned long ts;
  1378	
  1379		if (WARN_ON(!wiphy))
  1380			return NULL;
  1381	
  1382		if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
  1383			    (data->signal < 0 || data->signal > 100)))
  1384			return NULL;
  1385	
  1386		channel = cfg80211_get_bss_channel(wiphy, ie, ielen, data->chan,
  1387						   data->scan_width);
  1388		if (!channel)
  1389			return NULL;
  1390	
  1391		memcpy(tmp.pub.bssid, bssid, ETH_ALEN);
  1392		tmp.pub.channel = channel;
  1393		tmp.pub.scan_width = data->scan_width;
  1394		tmp.pub.signal = data->signal;
  1395		tmp.pub.beacon_interval = beacon_interval;
  1396		tmp.pub.capability = capability;
  1397		tmp.ts_boottime = data->boottime_ns;
  1398		if (non_tx_data) {
  1399			tmp.pub.transmitted_bss = non_tx_data->tx_bss;
  1400			ts = bss_from_pub(non_tx_data->tx_bss)->ts;
  1401			tmp.pub.bssid_index = non_tx_data->bssid_index;
  1402			tmp.pub.max_bssid_indicator = non_tx_data->max_bssid_indicator;
  1403		} else {
  1404			ts = jiffies;
  1405		}
  1406	
  1407		/*
  1408		 * If we do not know here whether the IEs are from a Beacon or Probe
  1409		 * Response frame, we need to pick one of the options and only use it
  1410		 * with the driver that does not provide the full Beacon/Probe Response
  1411		 * frame. Use Beacon frame pointer to avoid indicating that this should
  1412		 * override the IEs pointer should we have received an earlier
  1413		 * indication of Probe Response data.
  1414		 */
  1415		ies = kzalloc(sizeof(*ies) + ielen, gfp);
  1416		if (!ies)
  1417			return NULL;
  1418		ies->len = ielen;
  1419		ies->tsf = tsf;
  1420		ies->from_beacon = false;
  1421		memcpy(ies->data, ie, ielen);
  1422	
  1423		switch (ftype) {
  1424		case CFG80211_BSS_FTYPE_BEACON:
  1425			ies->from_beacon = true;
  1426			/* fall through */
  1427		case CFG80211_BSS_FTYPE_UNKNOWN:
  1428			rcu_assign_pointer(tmp.pub.beacon_ies, ies);
  1429			break;
  1430		case CFG80211_BSS_FTYPE_PRESP:
  1431			rcu_assign_pointer(tmp.pub.proberesp_ies, ies);
  1432			break;
  1433		}
  1434		rcu_assign_pointer(tmp.pub.ies, ies);
  1435	
> 1436		signal_valid = data->chan == channel->center_freq;
  1437		res = cfg80211_bss_update(wiphy_to_rdev(wiphy), &tmp, signal_valid, ts);
  1438		if (!res)
  1439			return NULL;
  1440	
  1441		if (channel->band == NL80211_BAND_60GHZ) {
  1442			bss_type = res->pub.capability & WLAN_CAPABILITY_DMG_TYPE_MASK;
  1443			if (bss_type == WLAN_CAPABILITY_DMG_TYPE_AP ||
  1444			    bss_type == WLAN_CAPABILITY_DMG_TYPE_PBSS)
  1445				regulatory_hint_found_beacon(wiphy, channel, gfp);
  1446		} else {
  1447			if (res->pub.capability & WLAN_CAPABILITY_ESS)
  1448				regulatory_hint_found_beacon(wiphy, channel, gfp);
  1449		}
  1450	
  1451		if (non_tx_data) {
  1452			/* this is a nontransmitting bss, we need to add it to
  1453			 * transmitting bss' list if it is not there
  1454			 */
  1455			if (cfg80211_add_nontrans_list(non_tx_data->tx_bss,
  1456						       &res->pub)) {
  1457				if (__cfg80211_unlink_bss(rdev, res))
  1458					rdev->bss_generation++;
  1459			}
  1460		}
  1461	
  1462		trace_cfg80211_return_bss(&res->pub);
  1463		/* cfg80211_bss_update gives us a referenced result */
  1464		return &res->pub;
  1465	}
  1466	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux