From patchwork Sun May 1 12:17:23 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: 8988631 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 22CF5BF29F for ; Sun, 1 May 2016 12:17:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23D62202AE for ; Sun, 1 May 2016 12:17:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A2D9202A1 for ; Sun, 1 May 2016 12:17:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752201AbcEAMRs (ORCPT ); Sun, 1 May 2016 08:17:48 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33002 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbcEAMRs (ORCPT ); Sun, 1 May 2016 08:17:48 -0400 Received: by mail-pa0-f67.google.com with SMTP id vv3so18912254pab.0; Sun, 01 May 2016 05:17:47 -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=tW8/xQJChurtU0yLEApWLOby4YpObBjc4ZXjQ1J96+s=; b=J2f17wVK0lV4md862PaIED0WsVe+QHhUxg2lzD4s23n9jSqjUHK6l8GFU8t1B1yFIx unsZHTrye22snXgF69KHDwX4NGAnxLtpERRpavQxzdvuPsiaY7SGcRJK50nTzpKA2PBe CYNZSN6Jl+Pu0CO6glqh1jNv3li4pI59O5GLSgDoDZr1g2hyCSzBrWeklqx7aw+b6+on gwacNaXw3KdD31GqO9H8bzS/nvZ4puJVoqpzHYd1gh8gx4zLnJpdfvN2mTcQXXb1qP+r tspzgraug5Or2lqWjdxZ2E01hVL1aa7ng1TBKif1IkQgYtIYH1nMuKD/pK9eKNvlxCvT gwfA== 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=tW8/xQJChurtU0yLEApWLOby4YpObBjc4ZXjQ1J96+s=; b=YYhS9n1fGIiDfT3KBxCNtvM3+WdLym3ClJQPIsNZf5OaIe0S26FfmjyI25iEOOlCq+ YlCBfAGM3SVfsXHrrfGmZ8YqyDjHzL1eT/1jBCWNmbdvnn1uFGVo7u+Ks/gbetolDSl2 ZgNNF299T+cNBgC9Qo1Af3V44ACFxMohD5AnvSwASDSjXmntIJbZ37jHzJER7s51mZ5c v8HlrggNsuQD4HfG/4wTvfRLbHb1FtUcyMPEiHgYBJD00xB9+avLBAVmJT1mBLd30Qys +SGY20kyR8VNryHPLBHZywpWtDsyRAg7p5JospioRSdXXg13rqIWsT0OB6TKFqoFKk4g 6hYg== X-Gm-Message-State: AOPr4FWAORqGfuQNIE5NyslOJLllF/Dz7W/A1W+H6PMlQ0Vf0xsDZ2olz81XksCH6MET3g== X-Received: by 10.66.72.198 with SMTP id f6mr44417830pav.60.1462105067206; Sun, 01 May 2016 05:17:47 -0700 (PDT) Received: from kp.domain.name ([110.235.28.83]) by smtp.gmail.com with ESMTPSA id u63sm37402524pfu.18.2016.05.01.05.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 May 2016 05:17:46 -0700 (PDT) From: Muhammad Falak R Wani To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Muhammad Falak R Wani Subject: [PATCH] Input: evdev - use RCU_INIT_POINTER() when NULLing Date: Sun, 1 May 2016 17:47:23 +0530 Message-Id: <1462105043-8642-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/evdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index e9ae3d5..51875b5 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -392,7 +392,7 @@ static int evdev_ungrab(struct evdev *evdev, struct evdev_client *client) if (grab != client) return -EINVAL; - rcu_assign_pointer(evdev->grab, NULL); + RCU_INIT_POINTER(evdev->grab, NULL); synchronize_rcu(); input_release_device(&evdev->handle);