Hi Arend, [auto build test WARNING on mac80211-next/master] [cannot apply to v4.11-rc5 next-20170407] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Arend-van-Spriel/cfg80211-support-multiple-scheduled-scans/20170408-175235 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master config: i386-randconfig-x008-201714 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c: In function 'brcmf_pno_config_sched_scans': >> drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:158:6: warning: 'mac_mask' may be used uninitialized in this function [-Wmaybe-uninitialized] u8 *mac_mask; ^~~~~~~~ In file included from arch/x86/include/asm/string.h:2:0, from include/linux/string.h:18, from arch/x86/include/asm/page_32.h:34, from arch/x86/include/asm/page.h:13, from arch/x86/include/asm/thread_info.h:11, from include/linux/thread_info.h:25, from arch/x86/include/asm/preempt.h:6, from include/linux/preempt.h:80, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/ktime.h:24, from include/linux/timer.h:5, from include/linux/netdevice.h:28, from drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:16: >> arch/x86/include/asm/string_32.h:182:25: warning: 'mac_addr' may be used uninitialized in this function [-Wmaybe-uninitialized] #define memcpy(t, f, n) __builtin_memcpy(t, f, n) ^~~~~~~~~~~~~~~~ drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:157:6: note: 'mac_addr' was declared here u8 *mac_addr; ^~~~~~~~ >> drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:120:22: warning: 'scan_freq' may be used uninitialized in this function [-Wmaybe-uninitialized] pfn_param.scan_freq = cpu_to_le32(scan_freq); drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:371:6: note: 'scan_freq' was declared here u32 scan_freq; ^~~~~~~~~ >> drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c:435:2: warning: 'buckets' may be used uninitialized in this function [-Wmaybe-uninitialized] kfree(buckets); ^~~~~~~~~~~~~~ -- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c: In function 'brcmf_pno_config_sched_scans': drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:158:6: warning: 'mac_mask' may be used uninitialized in this function [-Wmaybe-uninitialized] u8 *mac_mask; ^~~~~~~~ In file included from arch/x86/include/asm/string.h:2:0, from include/linux/string.h:18, from arch/x86/include/asm/page_32.h:34, from arch/x86/include/asm/page.h:13, from arch/x86/include/asm/thread_info.h:11, from include/linux/thread_info.h:25, from arch/x86/include/asm/preempt.h:6, from include/linux/preempt.h:80, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/ktime.h:24, from include/linux/timer.h:5, from include/linux/netdevice.h:28, from drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:16: >> arch/x86/include/asm/string_32.h:182:25: warning: 'mac_addr' may be used uninitialized in this function [-Wmaybe-uninitialized] #define memcpy(t, f, n) __builtin_memcpy(t, f, n) ^~~~~~~~~~~~~~~~ drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:157:6: note: 'mac_addr' was declared here u8 *mac_addr; ^~~~~~~~ drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:120:22: warning: 'scan_freq' may be used uninitialized in this function [-Wmaybe-uninitialized] pfn_param.scan_freq = cpu_to_le32(scan_freq); drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:371:6: note: 'scan_freq' was declared here u32 scan_freq; ^~~~~~~~~ drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c:435:2: warning: 'buckets' may be used uninitialized in this function [-Wmaybe-uninitialized] kfree(buckets); ^~~~~~~~~~~~~~ vim +/mac_mask +158 drivers/net/wireless//broadcom/brcm80211/brcmfmac/pno.c 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ > 16 #include <linux/netdevice.h> 17 #include <linux/gcd.h> 18 #include <net/cfg80211.h> 19 20 #include "core.h" 21 #include "debug.h" 22 #include "fwil.h" 23 #include "fwil_types.h" 24 #include "cfg80211.h" 25 #include "pno.h" 26 27 #define BRCMF_PNO_VERSION 2 28 #define BRCMF_PNO_REPEAT 4 29 #define BRCMF_PNO_FREQ_EXPO_MAX 3 30 #define BRCMF_PNO_IMMEDIATE_SCAN_BIT 3 31 #define BRCMF_PNO_ENABLE_BD_SCAN_BIT 5 32 #define BRCMF_PNO_ENABLE_ADAPTSCAN_BIT 6 33 #define BRCMF_PNO_REPORT_SEPARATELY_BIT 11 34 #define BRCMF_PNO_SCAN_INCOMPLETE 0 35 #define BRCMF_PNO_WPA_AUTH_ANY 0xFFFFFFFF 36 #define BRCMF_PNO_HIDDEN_BIT 2 37 #define BRCMF_PNO_SCHED_SCAN_PERIOD 30 38 39 #define BRCMF_PNO_MAX_BUCKETS 16 40 #define GSCAN_BATCH_NO_THR_SET 101 41 #define GSCAN_RETRY_THRESHOLD 3 42 43 struct brcmf_pno_info { 44 int n_reqs; 45 struct cfg80211_sched_scan_request *reqs[BRCMF_PNO_MAX_BUCKETS]; 46 }; 47 48 #define ifp_to_pno(_ifp) (_ifp)->drvr->config->pno 49 50 static int brcmf_pno_store_request(struct brcmf_pno_info *pi, 51 struct cfg80211_sched_scan_request *req) 52 { 53 if (WARN_ON(pi->n_reqs == BRCMF_PNO_MAX_BUCKETS)) { 54 brcmf_err("pno request storage full\n"); 55 return -ENOSPC; 56 } 57 brcmf_dbg(SCAN, "reqid=%llu\n", req->reqid); 58 pi->reqs[pi->n_reqs++] = req; 59 return 0; 60 } 61 62 static int brcmf_pno_remove_request(struct brcmf_pno_info *pi, u64 reqid) 63 { 64 int i; 65 66 /* find request */ 67 for (i = 0; i < pi->n_reqs; i++) { 68 if (pi->reqs[i]->reqid == reqid) 69 break; 70 } 71 /* request not found */ 72 if (WARN_ON(i == pi->n_reqs)) { 73 brcmf_err("reqid not found\n"); 74 return -ENOENT; 75 } 76 77 brcmf_dbg(SCAN, "reqid=%llu\n", reqid); 78 pi->n_reqs--; 79 80 /* if last we are done */ 81 if (!pi->n_reqs || i == pi->n_reqs) 82 return 0; 83 84 /* fill the gap with remaining requests */ 85 while (i <= pi->n_reqs - 1) { 86 pi->reqs[i] = pi->reqs[i + 1]; 87 i++; 88 } 89 return 0; 90 } 91 92 static int brcmf_pno_channel_config(struct brcmf_if *ifp, 93 struct brcmf_pno_config_le *cfg) 94 { 95 cfg->reporttype = 0; 96 cfg->flags = 0; 97 98 return brcmf_fil_iovar_data_set(ifp, "pfn_cfg", cfg, sizeof(*cfg)); 99 } 100 101 static int brcmf_pno_config(struct brcmf_if *ifp, u32 scan_freq, 102 u32 mscan, u32 bestn) 103 { 104 struct brcmf_pno_param_le pfn_param; 105 u16 flags; 106 u32 pfnmem; 107 s32 err; 108 109 memset(&pfn_param, 0, sizeof(pfn_param)); 110 pfn_param.version = cpu_to_le32(BRCMF_PNO_VERSION); 111 112 /* set extra pno params */ 113 flags = BIT(BRCMF_PNO_IMMEDIATE_SCAN_BIT) | 114 BIT(BRCMF_PNO_REPORT_SEPARATELY_BIT) | 115 BIT(BRCMF_PNO_ENABLE_ADAPTSCAN_BIT); 116 pfn_param.repeat = BRCMF_PNO_REPEAT; 117 pfn_param.exp = BRCMF_PNO_FREQ_EXPO_MAX; 118 119 /* set up pno scan fr */ > 120 pfn_param.scan_freq = cpu_to_le32(scan_freq); 121 122 if (mscan) { 123 pfnmem = bestn; 124 125 /* set bestn in firmware */ 126 err = brcmf_fil_iovar_int_set(ifp, "pfnmem", pfnmem); 127 if (err < 0) { 128 brcmf_err("failed to set pfnmem\n"); 129 goto exit; 130 } 131 /* get max mscan which the firmware supports */ 132 err = brcmf_fil_iovar_int_get(ifp, "pfnmem", &pfnmem); 133 if (err < 0) { 134 brcmf_err("failed to get pfnmem\n"); 135 goto exit; 136 } 137 mscan = min_t(u32, mscan, pfnmem); 138 pfn_param.mscan = mscan; 139 pfn_param.bestn = bestn; 140 flags |= BIT(BRCMF_PNO_ENABLE_BD_SCAN_BIT); 141 brcmf_dbg(INFO, "mscan=%d, bestn=%d\n", mscan, bestn); 142 } 143 144 pfn_param.flags = cpu_to_le16(flags); 145 err = brcmf_fil_iovar_data_set(ifp, "pfn_set", &pfn_param, 146 sizeof(pfn_param)); 147 if (err) 148 brcmf_err("pfn_set failed, err=%d\n", err); 149 150 exit: 151 return err; 152 } 153 154 static int brcmf_pno_set_random(struct brcmf_if *ifp, struct brcmf_pno_info *pi) 155 { 156 struct brcmf_pno_macaddr_le pfn_mac; > 157 u8 *mac_addr; > 158 u8 *mac_mask; 159 int err, i; 160 161 for (i = 0; i < pi->n_reqs; i++) --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip