From patchwork Sat Oct 29 16:19:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9403961 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 2DE4A60588 for ; Sat, 29 Oct 2016 16:19:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EDC329012 for ; Sat, 29 Oct 2016 16:19:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FC84290CD; Sat, 29 Oct 2016 16:19:44 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 90A5429012 for ; Sat, 29 Oct 2016 16:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932346AbcJ2QTm (ORCPT ); Sat, 29 Oct 2016 12:19:42 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34995 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932255AbcJ2QTl (ORCPT ); Sat, 29 Oct 2016 12:19:41 -0400 Received: by mail-pf0-f196.google.com with SMTP id s8so4250323pfj.2 for ; Sat, 29 Oct 2016 09:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sdxkebZcgLxSMc6kXrHu/wSOd00h6vS/ZaZxLFT+QjU=; b=uqXJAxbSnw/JTg1UIKBhxZyXv0GqknEv6Ohyghj891lKi90l1QPcR4X7Iw1Vc1rjuV mpbAWo0ExfoxuA1IgJ6a9OtxOQ462p3zcyiTiNLMRVMtkjZkOaTmSz+97GpLJo7wPg33 POAy13bXIlIiEnXTbkMwlLEPJpW0+sCTRVoxok2UAK1WQb1FsgbbD/89aBFi4Vfob/Es 1fYdQ50Emy8gTIPktUFpVY6KpPtYmF01WEJJ3dj65al3xPz60KFiqd5JJGteWg88hVc8 rcJUlmtIBI5Pl3UxHOKgk/RnjrXuqOI65joHFCmIyiNWaVYgcGofBGPX3E0vkB1Qk4Lw KOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sdxkebZcgLxSMc6kXrHu/wSOd00h6vS/ZaZxLFT+QjU=; b=lVTKX4yoFtpANlrIQUF50VveQpjNIGjw+voVzlWnqL0/vdSwgweixRCJFdYTzI0mZs DmOnnBZtKr0dSn4HcSFI7BeUN00Ia6FuDcV/egc/tdqjEOK/OcKeLQ15gs9Y7nUcr/k9 Y/z9rsyZR+sqfrbfqpusA4R+h7w83vjOXygFVdmxPf/SQ2/iT2JJeUBenCVKbE/t02wq e0FJUovh/uqgWQYGRdpXCyMZiK/QNY7TssdAuA6L9g+2PD50oDXA9XNUENSV9nvTHOwY soSLDJQ2Vxk7X7kEFo5RV1jaqL+s1YhUvY6ssc9x4KJLWSV2+wL1+yeW6KUJ+SnRfS99 BnxQ== X-Gm-Message-State: ABUngverzvCISREKTlMYYc0LjA/LJaXUiAfEy/ut2ZBN7D4d/aO22OaEWXr7nSigeN3fug== X-Received: by 10.99.121.133 with SMTP id u127mr28849784pgc.4.1477757981097; Sat, 29 Oct 2016 09:19:41 -0700 (PDT) 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 yx8sm26149562pac.29.2016.10.29.09.19.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 09:19:40 -0700 (PDT) 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 DEFINE_SPINLOCK() for spinlock Date: Sat, 29 Oct 2016 16:19:33 +0000 Message-Id: <1477757973-32052-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 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 spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Signed-off-by: Wei Yongjun Reviewed-by: Leon Romanosky Reviewed-by: Moni Shoua --- drivers/infiniband/sw/rxe/rxe_net.c | 6 +----- 1 file changed, 1 insertion(+), 5 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_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index b8258e4..4cb6378 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -46,7 +46,7 @@ #include "rxe_loc.h" static LIST_HEAD(rxe_dev_list); -static spinlock_t dev_list_lock; /* spinlock for device list */ +static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */ struct rxe_dev *net_to_rxe(struct net_device *ndev) { @@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = { int rxe_net_ipv4_init(void) { - spin_lock_init(&dev_list_lock); - recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net, htons(ROCE_V2_UDP_DPORT), false); if (IS_ERR(recv_sockets.sk4)) { @@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void) { #if IS_ENABLED(CONFIG_IPV6) - spin_lock_init(&dev_list_lock); - recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net, htons(ROCE_V2_UDP_DPORT), true); if (IS_ERR(recv_sockets.sk6)) {