Search Linux Wireless

Re: [PATCH v2] nl80211: reset regdom when reloading regdb

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

 



Hi Finn,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on mac80211/master linus/master v5.10-rc5 next-20201126]
[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]

url:    https://github.com/0day-ci/linux/commits/Finn-Behrens/nl80211-reset-regdom-when-reloading-regdb/20201126-184229
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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
        # https://github.com/0day-ci/linux/commit/60f644b62d0171339bf90cbb65245a171d2edc2a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Finn-Behrens/nl80211-reset-regdom-when-reloading-regdb/20201126-184229
        git checkout 60f644b62d0171339bf90cbb65245a171d2edc2a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11,
                    from net/wireless/reg.c:50:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   net/wireless/reg.c: In function 'reg_reload_regdb':
>> net/wireless/reg.c:1109:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1109 |  const struct ieee80211_regdomain *current_regdomain = NULL;
         |  ^~~~~
   net/wireless/reg.c:1113:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1113 |  struct regulatory_request *request = NULL;
         |  ^~~~~~
   net/wireless/reg.c: In function 'reg_process_hint_user':
>> net/wireless/reg.c:2686:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    2686 |      treatment == REG_REQ_ALREADY_SET &&
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
    2687 |    !user_request->reload)
         |    ~~~~~~~~~~~~~~~~~~~~~               

vim +1109 net/wireless/reg.c

  1077	
  1078	int reg_reload_regdb(void)
  1079	{
  1080		const struct firmware *fw;
  1081		void *db;
  1082		int err;
  1083	
  1084		err = request_firmware(&fw, "regulatory.db", &reg_pdev->dev);
  1085		if (err) {
  1086			pr_info("failed to load regulatory.db\n");
  1087			return err;
  1088		}
  1089	
  1090		if (!valid_regdb(fw->data, fw->size)) {
  1091			pr_info("loaded regulatory.db is malformed or signature is missing/invalid\n");
  1092			err = -ENODATA;
  1093			goto out;
  1094		}
  1095	
  1096		db = kmemdup(fw->data, fw->size, GFP_KERNEL);
  1097		if (!db) {
  1098			err = -ENOMEM;
  1099			goto out;
  1100		}
  1101	
  1102		rtnl_lock();
  1103		if (!IS_ERR_OR_NULL(regdb))
  1104			kfree(regdb);
  1105		regdb = db;
  1106		rtnl_unlock();
  1107	
  1108		// reset regulatory
> 1109		const struct ieee80211_regdomain *current_regdomain = NULL;
  1110	
  1111		current_regdomain = get_cfg80211_regdom();
  1112	
  1113		struct regulatory_request *request = NULL;
  1114	
  1115		request = kzalloc(sizeof(*request), GFP_KERNEL);
  1116		if (!request) {
  1117			err = -ENOMEM;
  1118			goto out;
  1119		}
  1120	
  1121		request->wiphy_idx = WIPHY_IDX_INVALID;
  1122		request->alpha2[0] = current_regdomain->alpha2[0];
  1123		request->alpha2[1] = current_regdomain->alpha2[1];
  1124		request->initiator = NL80211_USER_REG_HINT_USER;
  1125		request->user_reg_hint_type = NL80211_USER_REG_HINT_USER;
  1126		request->reload = true;
  1127	
  1128		queue_regulatory_request(request);
  1129	
  1130	 out:
  1131		release_firmware(fw);
  1132		return err;
  1133	}
  1134	

---
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