From patchwork Sun Mar 23 18:28:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Monam Agarwal X-Patchwork-Id: 3882071 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@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 4DAC89F2B6 for ; Mon, 24 Mar 2014 08:52:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B559202AE for ; Mon, 24 Mar 2014 08:52:26 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mail.kernel.org (Postfix) with ESMTP id 85DBA2026C for ; Mon, 24 Mar 2014 08:52:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2O8lfit030197; Mon, 24 Mar 2014 04:47:41 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2NITT7r017694 for ; Sun, 23 Mar 2014 14:29:29 -0400 Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2NITTfb005212; Sun, 23 Mar 2014 14:29:29 -0400 Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2NITRKG019554; Sun, 23 Mar 2014 14:29:28 -0400 Received: by mail-pb0-f48.google.com with SMTP id md12so4469507pbc.21 for ; Sun, 23 Mar 2014 11:29:27 -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=INwOAUVjds6O3QF89KizwFk5KSovoj2hPm09pXo9vt8=; b=aTxv8E7CToVNCtVsrU2UZtpPjKCfAPR8/M1JZOZM8Z5UMkT7IrWsA72HigL7oZTlrr Hzm/qrTz5VtKvwQD64D+8M+RvZVPFbd1wL/xlAU3qXVpCuKWbWljMwom0NSpvBotgwoN wGVWKuVLetNX9cz8ePfC4XD23rAX48w21FpJznuNVun8LluaE/dw2Tp+G51J6sImu5+5 9UNbEH3fDX3Bfe91fcN2pU2M8MNxpFmTBvkpRZ2Ec36jmtFT+4Bi03oJXLkrB2/NPTAm S4H5wuH3XUbxYDrApJKtbNrrGTjgZ+DMXnwetuBJ72k6tDrODXYQ/1PO/zFcJw/KuKsQ dbsw== X-Received: by 10.66.176.143 with SMTP id ci15mr67641926pac.35.1395599367642; Sun, 23 Mar 2014 11:29:27 -0700 (PDT) Received: from hacker.iiit.ac.in ([14.139.82.6]) by mx.google.com with ESMTPSA id it4sm26229081pbd.48.2014.03.23.11.29.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 11:29:26 -0700 (PDT) From: Monam Agarwal To: agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, neilb@suse.de, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 23 Mar 2014 23:58:27 +0530 Message-Id: <1395599307-6862-1-git-send-email-monamagarwal123@gmail.com> X-RedHat-Spam-Score: -2.85 (BAYES_00, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 24 Mar 2014 04:46:54 -0400 Subject: [dm-devel] [PATCH] drivers/md: Use RCU_INIT_POINTER(x, NULL) in dm.c X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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/md/dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 8c53b09..804412a 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2172,7 +2172,7 @@ static struct dm_table *__unbind(struct mapped_device *md) return NULL; dm_table_event_callback(map, NULL, NULL); - rcu_assign_pointer(md->map, NULL); + RCU_INIT_POINTER(md->map, NULL); dm_sync_table(md); return map;