public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <rong.a.chen@intel.com>
To: Tova Mussai <tova.mussai@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>
Subject: net/wireless/scan.c:552:2: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing
Date: Thu, 17 Dec 2020 09:07:10 +0800	[thread overview]
Message-ID: <20201217010710.GP67148@shao2-debian> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fab0fca1da5cdc48be051715cd9787df04fdce3a
commit: c8cb5b854b40f2ce52ccd032fa19750f4181d5fc nl80211/cfg80211: support 6 GHz scanning
compiler: c6x-elf-gcc (GCC) 9.3.0

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/wireless/scan.c:552:2: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
    pos++;
    ^

vim +552 net/wireless/scan.c

c8cb5b854b40f2c Tova Mussai 2020-09-18  530  
c8cb5b854b40f2c Tova Mussai 2020-09-18  531  static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry,
c8cb5b854b40f2c Tova Mussai 2020-09-18  532  				  const u8 *pos, u8 length,
c8cb5b854b40f2c Tova Mussai 2020-09-18  533  				  const struct element *ssid_elem,
c8cb5b854b40f2c Tova Mussai 2020-09-18  534  				  int s_ssid_tmp)
c8cb5b854b40f2c Tova Mussai 2020-09-18  535  {
c8cb5b854b40f2c Tova Mussai 2020-09-18  536  	/* skip the TBTT offset */
c8cb5b854b40f2c Tova Mussai 2020-09-18  537  	pos++;
c8cb5b854b40f2c Tova Mussai 2020-09-18  538  
c8cb5b854b40f2c Tova Mussai 2020-09-18  539  	memcpy(entry->bssid, pos, ETH_ALEN);
c8cb5b854b40f2c Tova Mussai 2020-09-18  540  	pos += ETH_ALEN;
c8cb5b854b40f2c Tova Mussai 2020-09-18  541  
c8cb5b854b40f2c Tova Mussai 2020-09-18  542  	if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_SSSID_BSS_PARAM) {
c8cb5b854b40f2c Tova Mussai 2020-09-18  543  		memcpy(&entry->short_ssid, pos,
c8cb5b854b40f2c Tova Mussai 2020-09-18  544  		       sizeof(entry->short_ssid));
c8cb5b854b40f2c Tova Mussai 2020-09-18  545  		entry->short_ssid_valid = true;
c8cb5b854b40f2c Tova Mussai 2020-09-18  546  		pos += 4;
c8cb5b854b40f2c Tova Mussai 2020-09-18  547  	}
c8cb5b854b40f2c Tova Mussai 2020-09-18  548  
c8cb5b854b40f2c Tova Mussai 2020-09-18  549  	/* skip non colocated APs */
c8cb5b854b40f2c Tova Mussai 2020-09-18  550  	if (!cfg80211_parse_bss_param(*pos, entry))
c8cb5b854b40f2c Tova Mussai 2020-09-18  551  		return -EINVAL;
c8cb5b854b40f2c Tova Mussai 2020-09-18 @552  	pos++;
c8cb5b854b40f2c Tova Mussai 2020-09-18  553  
c8cb5b854b40f2c Tova Mussai 2020-09-18  554  	if (length == IEEE80211_TBTT_INFO_OFFSET_BSSID_BSS_PARAM) {
c8cb5b854b40f2c Tova Mussai 2020-09-18  555  		/*
c8cb5b854b40f2c Tova Mussai 2020-09-18  556  		 * no information about the short ssid. Consider the entry valid
c8cb5b854b40f2c Tova Mussai 2020-09-18  557  		 * for now. It would later be dropped in case there are explicit
c8cb5b854b40f2c Tova Mussai 2020-09-18  558  		 * SSIDs that need to be matched
c8cb5b854b40f2c Tova Mussai 2020-09-18  559  		 */
c8cb5b854b40f2c Tova Mussai 2020-09-18  560  		if (!entry->same_ssid)
c8cb5b854b40f2c Tova Mussai 2020-09-18  561  			return 0;
c8cb5b854b40f2c Tova Mussai 2020-09-18  562  	}
c8cb5b854b40f2c Tova Mussai 2020-09-18  563  
c8cb5b854b40f2c Tova Mussai 2020-09-18  564  	if (entry->same_ssid) {
c8cb5b854b40f2c Tova Mussai 2020-09-18  565  		entry->short_ssid = s_ssid_tmp;
c8cb5b854b40f2c Tova Mussai 2020-09-18  566  		entry->short_ssid_valid = true;
c8cb5b854b40f2c Tova Mussai 2020-09-18  567  
c8cb5b854b40f2c Tova Mussai 2020-09-18  568  		/*
c8cb5b854b40f2c Tova Mussai 2020-09-18  569  		 * This is safe because we validate datalen in
c8cb5b854b40f2c Tova Mussai 2020-09-18  570  		 * cfg80211_parse_colocated_ap(), before calling this
c8cb5b854b40f2c Tova Mussai 2020-09-18  571  		 * function.
c8cb5b854b40f2c Tova Mussai 2020-09-18  572  		 */
c8cb5b854b40f2c Tova Mussai 2020-09-18  573  		memcpy(&entry->ssid, &ssid_elem->data,
c8cb5b854b40f2c Tova Mussai 2020-09-18  574  		       ssid_elem->datalen);
c8cb5b854b40f2c Tova Mussai 2020-09-18  575  		entry->ssid_len = ssid_elem->datalen;
c8cb5b854b40f2c Tova Mussai 2020-09-18  576  	}
c8cb5b854b40f2c Tova Mussai 2020-09-18  577  	return 0;
c8cb5b854b40f2c Tova Mussai 2020-09-18  578  }
c8cb5b854b40f2c Tova Mussai 2020-09-18  579  

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

                 reply	other threads:[~2020-12-17  1: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=20201217010710.GP67148@shao2-debian \
    --to=rong.a.chen@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tova.mussai@intel.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