From patchwork Fri Dec 9 10:54:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9467859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 883A4607D8 for ; Fri, 9 Dec 2016 10:55:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C82D28576 for ; Fri, 9 Dec 2016 10:55:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70191285D5; Fri, 9 Dec 2016 10:55:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B294285C7 for ; Fri, 9 Dec 2016 10:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933217AbcLIKy5 (ORCPT ); Fri, 9 Dec 2016 05:54:57 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:16671 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932960AbcLIKyz (ORCPT ); Fri, 9 Dec 2016 05:54:55 -0500 X-IronPort-AV: E=Sophos;i="5.33,324,1477954800"; d="scan'208";a="203560263" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Dec 2016 11:54:52 +0100 Date: Fri, 9 Dec 2016 11:54:51 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Selvin Xavier cc: dledford@redhat.com, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] bnxt_re: fix itnull.cocci warnings Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP list_for_each_entry iterator variable cannot be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Selvin Xavier Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- 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 --- 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 !=