From patchwork Sat Nov 3 10:58:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1692041 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1F8B2DFB7B for ; Sat, 3 Nov 2012 11:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755646Ab2KCK76 (ORCPT ); Sat, 3 Nov 2012 06:59:58 -0400 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:62865 "EHLO mail4-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754813Ab2KCK6z (ORCPT ); Sat, 3 Nov 2012 06:58:55 -0400 X-IronPort-AV: E=Sophos;i="4.80,705,1344204000"; d="scan'208";a="161245677" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Nov 2012 11:58:46 +0100 From: Julia Lawall To: Faisal Latif Cc: kernel-janitors@vger.kernel.org, Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/16] drivers/infiniband/hw/nes: use WARN Date: Sat, 3 Nov 2012 11:58:37 +0100 Message-Id: <1351940317-14812-17-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr> References: <1351940317-14812-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Julia Lawall Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by: Julia Lawall --- drivers/infiniband/hw/nes/nes_cm.c | 6 ++---- drivers/infiniband/hw/nes/nes_mgt.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) -- 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 --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index cfaacaf..8a15a1d 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -629,11 +629,9 @@ static void build_rdma0_msg(struct nes_cm_node *cm_node, struct nes_qp **nesqp_a case SEND_RDMA_READ_ZERO: default: - if (cm_node->send_rdma0_op != SEND_RDMA_READ_ZERO) { - printk(KERN_ERR "%s[%u]: Unsupported RDMA0 len operation=%u\n", + if (cm_node->send_rdma0_op != SEND_RDMA_READ_ZERO) + WARN(1, KERN_ERR "%s[%u]: Unsupported RDMA0 len operation=%u\n", __func__, __LINE__, cm_node->send_rdma0_op); - WARN_ON(1); - } nes_debug(NES_DBG_CM, "Sending first rdma operation.\n"); wqe->wqe_words[NES_IWARP_SQ_WQE_MISC_IDX] = cpu_to_le32(NES_IWARP_SQ_OP_RDMAR); diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c index 3ba7be3..53bb88c 100644 --- a/drivers/infiniband/hw/nes/nes_mgt.c +++ b/drivers/infiniband/hw/nes/nes_mgt.c @@ -649,11 +649,9 @@ static void nes_chg_qh_handler(struct nes_device *nesdev, struct nes_cqp_request nesqp = qh_chg->nesqp; /* Should we handle the bad completion */ - if (cqp_request->major_code) { - printk(KERN_ERR PFX "Invalid cqp_request major_code=0x%x\n", + if (cqp_request->major_code) + WARN(1, KERN_ERR PFX "Invalid cqp_request major_code=0x%x\n", cqp_request->major_code); - WARN_ON(1); - } switch (nesqp->pau_state) { case PAU_DEL_QH: