From patchwork Sat Mar 22 20:36:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Monam Agarwal X-Patchwork-Id: 3878001 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A2E039F370 for ; Sat, 22 Mar 2014 20:37:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF86F20220 for ; Sat, 22 Mar 2014 20:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 043FA20204 for ; Sat, 22 Mar 2014 20:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751159AbaCVUhj (ORCPT ); Sat, 22 Mar 2014 16:37:39 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:50896 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbaCVUhi (ORCPT ); Sat, 22 Mar 2014 16:37:38 -0400 Received: by mail-pd0-f169.google.com with SMTP id fp1so3718358pdb.14 for ; Sat, 22 Mar 2014 13:37:38 -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=NYV9VGAnIUYrNteSxTKVPtmj7AYrfTWPsbjv1lLwfaI=; b=OKHlOFj9i5EIBG4znJ0kb8m24KKgRrrtACwjFLgJP3PAtrcDl8/4AxaWQpJQskfzUf lw8r0wVsOxYxM4RBPGEoIJAAfEBmrPCxHgv/36l3mBj9/cCFNzYR9G1IF+AY+FEhnvOl 22pbDFE+FWh6fiSwTc78aTn9rq3KUoBJvwYN7HT7UmDTVCRIVFFdCMc0OiDJ2WFcrdSA x3S0kp42pGH059jRpoXBiqTkHa+Egzx397oiy4zhngXlP++JD+UaoPFe7R2QE3wmOy83 I36twKbh67VTbTZk5vXXcivLDvmPbTjyKHlv14s4qN2pueHnQGo+E5xoETyka+DDQEG5 APkw== X-Received: by 10.67.5.131 with SMTP id cm3mr62603676pad.92.1395520658338; Sat, 22 Mar 2014 13:37:38 -0700 (PDT) Received: from hacker.iiit.ac.in ([14.139.82.6]) by mx.google.com with ESMTPSA id hc4sm17310398pbc.29.2014.03.22.13.37.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Mar 2014 13:37:37 -0700 (PDT) From: Monam Agarwal To: infinipath@intel.com, roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/infiniband: Use RCU_INIT_POINTER(x, NULL) in hw/qib/qib_keys.c Date: Sun, 23 Mar 2014 02:06:39 +0530 Message-Id: <1395520599-3411-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Acked-by: Mike Marciniszyn --- drivers/infiniband/hw/qib/qib_keys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index 3b9afcc..ad843c7 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c @@ -122,10 +122,10 @@ void qib_free_lkey(struct qib_mregion *mr) if (!mr->lkey_published) goto out; if (lkey == 0) - rcu_assign_pointer(dev->dma_mr, NULL); + RCU_INIT_POINTER(dev->dma_mr, NULL); else { r = lkey >> (32 - ib_qib_lkey_table_size); - rcu_assign_pointer(rkt->table[r], NULL); + RCU_INIT_POINTER(rkt->table[r], NULL); } qib_put_mr(mr); mr->lkey_published = 0;