From patchwork Sun May 1 12:25:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Falak R Wani X-Patchwork-Id: 8988731 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72D38BF29F for ; Sun, 1 May 2016 12:25:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1A4020295 for ; Sun, 1 May 2016 12:25:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCB162028D for ; Sun, 1 May 2016 12:25:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261AbcEAMZr (ORCPT ); Sun, 1 May 2016 08:25:47 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:32890 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbcEAMZr (ORCPT ); Sun, 1 May 2016 08:25:47 -0400 Received: by mail-pa0-f66.google.com with SMTP id vv3so18923350pab.0; Sun, 01 May 2016 05:25:46 -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; bh=ofkv/LFR14nHMzDrOothyh5y1XsMzH9g31URmqFv1Vc=; b=lx+WpDPOhhQe2XnjJicVQRn6qtzDXMKvKrhr0V8okHBSPe9/Ee22GHUAx3tQ13Lq4v 82H6nfmw+8sJGok83nWRiCiSOB/fZbXLLKEOkkXvX1Yw+JMWLBUFpgu+v1mZ8OFRRiMr EA9KzZlvlABt5uX3QEoUbOSF4lO5IOJMWqVzIFtHzRkFElX0CDPOOJnzs46eULxdt3on 09DNAwmlEd5DINiJixEbh/CegFKU70s1144dTsem98NxLpz2C+8tUCQxdqTsyUAkUsBN 1ZorXimGeUawz8BqnZyy/Qn1NokEKvlYpyfd2UmtyY/IMoy00RkSrB8p8mG8P3xfuTxh Ip/A== 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; bh=ofkv/LFR14nHMzDrOothyh5y1XsMzH9g31URmqFv1Vc=; b=X/Enh+syqpmpQLgdixqPETQRzOHkfM4pmoyJ8bwp7dD8ieM8LAGDdtyDn2HCz8rpLj qwNiKI4T2dNb9EOvBHypdPkpJLUx05CXR5KzyPJvYYyojyMTcIEcUK9/9/zluJbLgjL4 3YXHUGE4daMUdEVHCzuhUFu9Tc2XcPWQNZ3hD1eRTObM3oRM1wQzs0Mw8iPBO6KTd7zv E0EOZq7SNlA6CDjZzbYqDN8IJPac+BmNg6KwZwIWHhW/F9pl8kuH8ThKyhOZT1MMVhbN WQFM9QfMlN/UIylYjCRZ6Lq3LWjHf4b2vQB3jDLEO4IH410d1ahYCjuYajuRmOSdL/wm g2AA== X-Gm-Message-State: AOPr4FW51EyLccxPui3OMnJ3GdKdWspDyY5nQqerlVYblTP3NG8N88VF/db9MOBcwTkcIw== X-Received: by 10.66.134.15 with SMTP id pg15mr43264490pab.98.1462105546188; Sun, 01 May 2016 05:25:46 -0700 (PDT) Received: from kp.domain.name ([110.235.28.83]) by smtp.gmail.com with ESMTPSA id 80sm37416133pfx.68.2016.05.01.05.25.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 May 2016 05:25:45 -0700 (PDT) From: Muhammad Falak R Wani To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: use RCU_INIT_POINTER() when NULLing. Date: Sun, 1 May 2016 17:55:40 +0530 Message-Id: <1462105540-8835-1-git-send-email-falakreyaz@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.8 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 It is safe to use RCU_INIT_POINTER() to NULL a pointer, instead of rcu_assign_pointer(). This results in slightly smaller/faster code. Signed-off-by: Muhammad Falak R Wani --- drivers/input/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index b87ffbd..e59ac56 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -548,7 +548,7 @@ static void __input_release_device(struct input_handle *handle) grabber = rcu_dereference_protected(dev->grab, lockdep_is_held(&dev->mutex)); if (grabber == handle) { - rcu_assign_pointer(dev->grab, NULL); + RCU_INIT_POINTER(dev->grab, NULL); /* Make sure input_pass_event() notices that grab is gone */ synchronize_rcu();