From patchwork Tue Feb 7 15:15:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9560373 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 2A14960434 for ; Tue, 7 Feb 2017 15:15:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1CE2841C for ; Tue, 7 Feb 2017 15:15:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F5A82841E; Tue, 7 Feb 2017 15:15:20 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 B6D1D2841C for ; Tue, 7 Feb 2017 15:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbdBGPPS (ORCPT ); Tue, 7 Feb 2017 10:15:18 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36647 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754016AbdBGPPR (ORCPT ); Tue, 7 Feb 2017 10:15:17 -0500 Received: by mail-pg0-f66.google.com with SMTP id 75so12376581pgf.3 for ; Tue, 07 Feb 2017 07:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WIdKJ/XxhhdPGMTjMsxw4dmf7QZRbW1gREiyWFBBvz4=; b=PauVPUkq0ol5JmTxQqyoLQ+1JY4l9EMqu6rzAlnbMVgmOrDLF7lIOPC6a/e/Dx00x1 MhA3BFYhngRsQpLl0XDy2iAvkZoUNc3h/UNVsahCB4bbA4QwLuc/KwXn113Jdv0nVPVa FwXJCNB0N7H8vtGPsdztRdGwmz1O/3I6VR68Ft9t8ws0/lbloF1CZhfHORBJBJdfOx99 mBFEX6sPgGu9++D743WCyHg7OTj00d3neqZ5XQNMWHjgXhlg98zHdoqw8qpFg+UwGamm wNxtp2IK7V29jv7aSvVGJPJrc0KIC4hAMdLEjJstuAIk8Hf1ZziwuZ+h1C38USbsxMUY hFrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WIdKJ/XxhhdPGMTjMsxw4dmf7QZRbW1gREiyWFBBvz4=; b=nbrZgz83B/gtK/aZDNtqzPE7dPUQkPoR9h5Ds+LRXZ8FxouPJXGKW/oQZ15GTrleo4 acBSaAGgDAY4eIxeRvFma7AannfkG6/4ISC1S6AwZVokqPAG0HK+eb1IIwXg88HTjYxi RiJHAkyPfkV/vljnWCJOGHmJaF5xFSeFQXpVNzVLlwWnptjF3VeIOM/q1ouJfiJvBOVW C1N2yZgBih9AuEjIEvIeP2+Q4dQ9e/o3uDZJTc8e8JT7KhfM4V28fpxdjQi2Ca8DH3hA g7K8w8tlDCwa58fMxjU382nh+uA1twASrgLXQW5wREP2BR5lnzVDq4T/oRc1BTlK8qBM DScw== X-Gm-Message-State: AIkVDXJZlkh3ytfOokm+q1RviPIq3CI3UkLoZJjv8UlvTw/XNHTNQTprVgpyso90vRxJAA== X-Received: by 10.99.173.66 with SMTP id y2mr20927369pgo.35.1486480516918; Tue, 07 Feb 2017 07:15:16 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id g28sm12489449pgn.3.2017.02.07.07.15.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 07:15:16 -0800 (PST) From: Wei Yongjun To: Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock Cc: Wei Yongjun , linux-rdma@vger.kernel.org Subject: [PATCH -next] IB/rxe: use setup_timer to simplify the code Date: Tue, 7 Feb 2017 15:15:10 +0000 Message-Id: <20170207151510.12503-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 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 From: Wei Yongjun Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Wei Yongjun Reviewed-by: Leon Romanovsky --- drivers/infiniband/sw/rxe/rxe_qp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 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/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 5749ff0..f98a19e 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -273,13 +273,8 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, rxe_init_task(rxe, &qp->comp.task, qp, rxe_completer, "comp"); - init_timer(&qp->rnr_nak_timer); - qp->rnr_nak_timer.function = rnr_nak_timer; - qp->rnr_nak_timer.data = (unsigned long)qp; - - init_timer(&qp->retrans_timer); - qp->retrans_timer.function = retransmit_timer; - qp->retrans_timer.data = (unsigned long)qp; + setup_timer(&qp->rnr_nak_timer, rnr_nak_timer, (unsigned long)qp); + setup_timer(&qp->retrans_timer, retransmit_timer, (unsigned long)qp); qp->qp_timeout_jiffies = 0; /* Can't be set for UD/UC in modify_qp */ return 0;