From patchwork Sun Mar 23 18:25:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Monam Agarwal X-Patchwork-Id: 3879541 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0E9A6BF540 for ; Sun, 23 Mar 2014 18:26:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05F3D20200 for ; Sun, 23 Mar 2014 18:26:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09B12201FE for ; Sun, 23 Mar 2014 18:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750807AbaCWS0W (ORCPT ); Sun, 23 Mar 2014 14:26:22 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:49356 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbaCWS0W (ORCPT ); Sun, 23 Mar 2014 14:26:22 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so4480390pbb.36 for ; Sun, 23 Mar 2014 11:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=Rs9HYA0G8s2r/1WKuJ6X0G9TI0ra7zgBt0Hpq5dM5Xc=; b=TnMUsW0dS7fj4uvPWjmnrnrc74Hpphv//zEdwnMPjO91oJh8PWYx0Pyxow630dfEGH UcAqQURJ3BNZdqDPklFBJuGZ+55JYCnDT8TQVIQHwftr8TKDZSSmt9Qg0NjEOI3HedDJ EXGalH0XvCv6/403s9pgEWrott5Ayzs7ZyltvRxBpWLvXAD/atpMUOmtOX2YVWCyC9bb AwiFzMZM8vowscQSGUsjK3BtTLMeBj0eiqCLi9lgvhDFx8WTsrJ67WIkr6WbuqHIW72L NH4uRddlnby2zhKjgqZGhtyS08fuMVqWr0LmjlqoDiY19ekYjAMv02NJvgr+xVb91DL9 83ug== X-Received: by 10.68.171.193 with SMTP id aw1mr66414979pbc.117.1395599181349; Sun, 23 Mar 2014 11:26:21 -0700 (PDT) Received: from hacker.iiit.ac.in ([14.139.82.6]) by mx.google.com with ESMTPSA id gu11sm26192034pbd.74.2014.03.23.11.26.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 11:26:20 -0700 (PDT) From: Monam Agarwal To: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, ogerlitz@mellanox.com, mschmidt@redhat.com, erezsh@mellanox.com, jinpu.wang@profitbricks.com, dledford@redhat.com, foraker1@llnl.gov, kaber@trash.net, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/infiniband: Use RCU_INIT_POINTER(x, NULL) in ulp/ipoib/ipoib_main.c Date: Sun, 23 Mar 2014 23:55:19 +0530 Message-Id: <1395599119-6731-1-git-send-email-monamagarwal123@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) The rcu_assign_pointer() ensures that the initialization of a structure is carried out before storing a pointer to that structure. And in the case of the NULL pointer, there is no structure to initialize. So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL) Signed-off-by: Monam Agarwal --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 5786a78..64cd5b5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1229,7 +1229,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv) } free_htbl: - rcu_assign_pointer(ntbl->htbl, NULL); + RCU_INIT_POINTER(ntbl->htbl, NULL); call_rcu(&htbl->rcu, neigh_hash_free_rcu); out_unlock: