diff mbox

bnxt_re: fix itnull.cocci warnings

Message ID alpine.DEB.2.10.1612091152080.2899@hadrien (mailing list archive)
State Not Applicable
Headers show

Commit Message

Julia Lawall Dec. 9, 2016, 10:54 a.m. UTC
list_for_each_entry iterator variable cannot be NULL.

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

url:
https://github.com/0day-ci/linux/commits/Selvin-Xavier/Broadcom-RoCE-Driver-bnxt_re/20161209-154823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
master

I received some other warnings as well.  Not sure if they have been passed
along already:

>> drivers/infiniband/hw/bnxtre/bnxt_re_ib_verbs.c:2455:4-14: code aligned
with following code on line 2456
--
>> drivers/infiniband/hw/bnxtre/bnxt_re_main.c:1047:2-20: code aligned
with following code on line 1048
   drivers/infiniband/hw/bnxtre/bnxt_re_main.c:1188:3-43: code aligned
with following code on line 1190
--
>> drivers/infiniband/hw/bnxtre/bnxt_re_main.c:834:6-8: ERROR: iterator
variable bound on line 832 cannot be NULL
--
>> drivers/infiniband/hw/bnxtre/bnxt_re_ib_verbs.c:2512:5-13: WARNING:
Unsigned expression compared with zero: pkt_type < 0


 bnxt_re_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/infiniband/hw/bnxtre/bnxt_re_main.c
+++ b/drivers/infiniband/hw/bnxtre/bnxt_re_main.c
@@ -831,7 +831,7 @@  static void bnxt_re_dev_stop(struct bnxt
 	mutex_lock(&rdev->qp_lock);
 	list_for_each_entry(qp, &rdev->qp_list, list) {
 		/* Modify the state of all QPs except QP1/Shadow QP */
-		if (qp && !bnxt_re_is_qp1_or_shadow_qp(rdev, qp)) {
+		if (!bnxt_re_is_qp1_or_shadow_qp(rdev, qp)) {
 			if (qp->qplib_qp.state !=
 			    CMDQ_MODIFY_QP_NEW_STATE_RESET ||
 			    qp->qplib_qp.state !=