drivers/infiniband/hw/bnxt_re/qplib_fp.c:335:4: note: in expansion of macro 'if'

From: kbuild test robot
Date: Fri Feb 02 2018 - 03:12:09 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4bf772b14675411a69b3c807f73006de0fe4b649
commit: 37cb11acf1f72a007a85894a6dd2ec93932bde46 RDMA/bnxt_re: Add SRQ support for Broadcom adapters
date: 2 weeks ago
config: i386-randconfig-sb0-02021411 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
git checkout 37cb11acf1f72a007a85894a6dd2ec93932bde46
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers/infiniband/hw/bnxt_re/qplib_fp.c: In function 'bnxt_qplib_service_nq':
drivers/infiniband/hw/bnxt_re/qplib_fp.c:333:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
bnxt_qplib_arm_srq((struct bnxt_qplib_srq *)q_handle,
^
In file included from include/linux/kernel.h:10:0,
from include/linux/interrupt.h:6,
from drivers/infiniband/hw/bnxt_re/qplib_fp.c:39:
drivers/infiniband/hw/bnxt_re/qplib_fp.c:336:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(struct bnxt_qplib_srq *)q_handle,
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> drivers/infiniband/hw/bnxt_re/qplib_fp.c:335:4: note: in expansion of macro 'if'
if (!nq->srqn_handler(nq,
^
drivers/infiniband/hw/bnxt_re/qplib_fp.c:336:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(struct bnxt_qplib_srq *)q_handle,
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
>> drivers/infiniband/hw/bnxt_re/qplib_fp.c:335:4: note: in expansion of macro 'if'
if (!nq->srqn_handler(nq,
^
drivers/infiniband/hw/bnxt_re/qplib_fp.c:336:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(struct bnxt_qplib_srq *)q_handle,
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^
>> drivers/infiniband/hw/bnxt_re/qplib_fp.c:335:4: note: in expansion of macro 'if'
if (!nq->srqn_handler(nq,
^
In file included from include/linux/byteorder/little_endian.h:5:0,
from arch/x86/include/uapi/asm/byteorder.h:5,
from include/asm-generic/bitops/le.h:6,
from arch/x86/include/asm/bitops.h:518,
from include/linux/bitops.h:38,
from include/linux/kernel.h:11,
from include/linux/interrupt.h:6,
from drivers/infiniband/hw/bnxt_re/qplib_fp.c:39:
drivers/infiniband/hw/bnxt_re/qplib_fp.c: In function 'bnxt_qplib_create_srq':
include/uapi/linux/byteorder/little_endian.h:31:43: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
^
include/linux/byteorder/generic.h:86:21: note: in expansion of macro '__cpu_to_le64'
#define cpu_to_le64 __cpu_to_le64
^
drivers/infiniband/hw/bnxt_re/qplib_fp.c:567:19: note: in expansion of macro 'cpu_to_le64'
req.srq_handle = cpu_to_le64(srq);
^

vim +/if +335 drivers/infiniband/hw/bnxt_re/qplib_fp.c

274
275 static void bnxt_qplib_service_nq(unsigned long data)
276 {
277 struct bnxt_qplib_nq *nq = (struct bnxt_qplib_nq *)data;
278 struct bnxt_qplib_hwq *hwq = &nq->hwq;
279 struct nq_base *nqe, **nq_ptr;
280 struct bnxt_qplib_cq *cq;
281 int num_cqne_processed = 0;
282 int num_srqne_processed = 0;
283 u32 sw_cons, raw_cons;
284 u16 type;
285 int budget = nq->budget;
286 u64 q_handle;
287
288 /* Service the NQ until empty */
289 raw_cons = hwq->cons;
290 while (budget--) {
291 sw_cons = HWQ_CMP(raw_cons, hwq);
292 nq_ptr = (struct nq_base **)hwq->pbl_ptr;
293 nqe = &nq_ptr[NQE_PG(sw_cons)][NQE_IDX(sw_cons)];
294 if (!NQE_CMP_VALID(nqe, raw_cons, hwq->max_elements))
295 break;
296
297 /*
298 * The valid test of the entry must be done first before
299 * reading any further.
300 */
301 dma_rmb();
302
303 type = le16_to_cpu(nqe->info10_type) & NQ_BASE_TYPE_MASK;
304 switch (type) {
305 case NQ_BASE_TYPE_CQ_NOTIFICATION:
306 {
307 struct nq_cn *nqcne = (struct nq_cn *)nqe;
308
309 q_handle = le32_to_cpu(nqcne->cq_handle_low);
310 q_handle |= (u64)le32_to_cpu(nqcne->cq_handle_high)
311 << 32;
312 cq = (struct bnxt_qplib_cq *)(unsigned long)q_handle;
313 bnxt_qplib_arm_cq_enable(cq);
314 spin_lock_bh(&cq->compl_lock);
315 atomic_set(&cq->arm_state, 0);
316 if (!nq->cqn_handler(nq, (cq)))
317 num_cqne_processed++;
318 else
319 dev_warn(&nq->pdev->dev,
320 "QPLIB: cqn - type 0x%x not handled",
321 type);
322 spin_unlock_bh(&cq->compl_lock);
323 break;
324 }
325 case NQ_BASE_TYPE_SRQ_EVENT:
326 {
327 struct nq_srq_event *nqsrqe =
328 (struct nq_srq_event *)nqe;
329
330 q_handle = le32_to_cpu(nqsrqe->srq_handle_low);
331 q_handle |= (u64)le32_to_cpu(nqsrqe->srq_handle_high)
332 << 32;
333 bnxt_qplib_arm_srq((struct bnxt_qplib_srq *)q_handle,
334 DBR_DBR_TYPE_SRQ_ARMENA);
> 335 if (!nq->srqn_handler(nq,
336 (struct bnxt_qplib_srq *)q_handle,
337 nqsrqe->event))
338 num_srqne_processed++;
339 else
340 dev_warn(&nq->pdev->dev,
341 "QPLIB: SRQ event 0x%x not handled",
342 nqsrqe->event);
343 break;
344 }
345 case NQ_BASE_TYPE_DBQ_EVENT:
346 break;
347 default:
348 dev_warn(&nq->pdev->dev,
349 "QPLIB: nqe with type = 0x%x not handled",
350 type);
351 break;
352 }
353 raw_cons++;
354 }
355 if (hwq->cons != raw_cons) {
356 hwq->cons = raw_cons;
357 NQ_DB_REARM(nq->bar_reg_iomem, hwq->cons, hwq->max_elements);
358 }
359 }
360

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip