Hi Michael, [auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Michael-Chan/bnxt_en-Add-interface-to-support-RDMA-driver/20161207-053721 config: i386-allmodconfig (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/ethernet/broadcom/bnxt/bnxt_ulp.c: In function 'bnxt_unregister_dev': >> drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c:97:4: warning: 'i' may be used >> uninitialized in this function [-Wmaybe-uninitialized] i++; ~^~ drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c: In function 'bnxt_ulp_stop': >> drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c:219:6: warning: 'ops' may be >> used uninitialized in this function [-Wmaybe-uninitialized] if (!ops || !ops->ulp_stop) ^ vim +/i +97 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c 91 RCU_INIT_POINTER(ulp->ulp_ops, NULL); 92 synchronize_rcu(); 93 ulp->max_async_event_id = 0; 94 ulp->async_events_bmap = NULL; 95 while (atomic_read(&ulp->ref_count) != 0 && i < 10) { 96 msleep(100); > 97 i++; 98 } 99 return 0; 100 } 101 102 static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id, 103 struct bnxt_msix_entry *ent, int num_msix) 104 { 105 struct net_device *dev = edev->net; 106 struct bnxt *bp = netdev_priv(dev); 107 int max_idx, max_cp_rings; 108 int avail_msix, i, idx; 109 110 ASSERT_RTNL(); 111 if (ulp_id != BNXT_ROCE_ULP) 112 return -EINVAL; 113 114 if (!(bp->flags & BNXT_FLAG_USING_MSIX)) 115 return -ENODEV; 116 117 max_cp_rings = bnxt_get_max_func_cp_rings(bp); 118 max_idx = min_t(int, bp->total_irqs, max_cp_rings); 119 avail_msix = max_idx - bp->cp_nr_rings; 120 if (!avail_msix) 121 return -ENOMEM; 122 if (avail_msix > num_msix) 123 avail_msix = num_msix; 124 125 idx = max_idx - avail_msix; 126 for (i = 0; i < avail_msix; i++) { 127 ent[i].vector = bp->irq_tbl[idx + i].vector; 128 ent[i].ring_idx = idx + i; 129 ent[i].db_offset = (idx + i) * 0x80; 130 } 131 bnxt_set_max_func_irqs(bp, max_idx - avail_msix); 132 bnxt_set_max_func_cp_rings(bp, max_cp_rings - avail_msix); 133 edev->ulp_tbl[ulp_id].msix_requested = avail_msix; 134 return avail_msix; 135 } 136 137 static int bnxt_free_msix_vecs(struct bnxt_en_dev *edev, int ulp_id) 138 { 139 struct net_device *dev = edev->net; 140 struct bnxt *bp = netdev_priv(dev); 141 int max_cp_rings, msix_requested; 142 143 ASSERT_RTNL(); 144 if (ulp_id != BNXT_ROCE_ULP) 145 return -EINVAL; 146 147 max_cp_rings = bnxt_get_max_func_cp_rings(bp); 148 msix_requested = edev->ulp_tbl[ulp_id].msix_requested; 149 bnxt_set_max_func_cp_rings(bp, max_cp_rings + msix_requested); 150 edev->ulp_tbl[ulp_id].msix_requested = 0; 151 bnxt_set_max_func_irqs(bp, bp->total_irqs); 152 return 0; 153 } 154 155 void bnxt_subtract_ulp_resources(struct bnxt *bp, int ulp_id) 156 { 157 ASSERT_RTNL(); 158 if (bnxt_ulp_registered(bp->edev, ulp_id)) { 159 struct bnxt_en_dev *edev = bp->edev; 160 unsigned int msix_req, max; 161 162 msix_req = edev->ulp_tbl[ulp_id].msix_requested; 163 max = bnxt_get_max_func_cp_rings(bp); 164 bnxt_set_max_func_cp_rings(bp, max - msix_req); 165 max = bnxt_get_max_func_stat_ctxs(bp); 166 bnxt_set_max_func_stat_ctxs(bp, max - 1); 167 } 168 } 169 170 static int bnxt_send_msg(struct bnxt_en_dev *edev, int ulp_id, 171 struct bnxt_fw_msg *fw_msg) 172 { 173 struct net_device *dev = edev->net; 174 struct bnxt *bp = netdev_priv(dev); 175 struct input *req; 176 int rc; 177 178 mutex_lock(&bp->hwrm_cmd_lock); 179 req = fw_msg->msg; 180 req->resp_addr = cpu_to_le64(bp->hwrm_cmd_resp_dma_addr); 181 rc = _hwrm_send_message(bp, fw_msg->msg, fw_msg->msg_len, 182 fw_msg->timeout); 183 if (!rc) { 184 struct output *resp = bp->hwrm_cmd_resp_addr; 185 u32 len = le16_to_cpu(resp->resp_len); 186 187 if (fw_msg->resp_max_len < len) 188 len = fw_msg->resp_max_len; 189 190 memcpy(fw_msg->resp, resp, len); 191 } 192 mutex_unlock(&bp->hwrm_cmd_lock); 193 return rc; 194 } 195 196 static void bnxt_ulp_get(struct bnxt_ulp *ulp) 197 { 198 atomic_inc(&ulp->ref_count); 199 } 200 201 static void bnxt_ulp_put(struct bnxt_ulp *ulp) 202 { 203 atomic_dec(&ulp->ref_count); 204 } 205 206 void bnxt_ulp_stop(struct bnxt *bp) 207 { 208 struct bnxt_en_dev *edev = bp->edev; 209 struct bnxt_ulp_ops *ops; 210 int i; 211 212 if (!edev) 213 return; 214 215 for (i = 0; i < BNXT_MAX_ULP; i++) { 216 struct bnxt_ulp *ulp = &edev->ulp_tbl[i]; 217 218 rtnl_dereference(ulp->ulp_ops); > 219 if (!ops || !ops->ulp_stop) 220 continue; 221 ops->ulp_stop(ulp->handle); 222 } --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip