From patchwork Wed May 11 21:25:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 778422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4BLQ3kw007518 for ; Wed, 11 May 2011 21:26:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756239Ab1EKV0B (ORCPT ); Wed, 11 May 2011 17:26:01 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]:34344 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756123Ab1EKV0A (ORCPT ); Wed, 11 May 2011 17:26:00 -0400 Received: by wwk4 with SMTP id 4so4847598wwk.1 for ; Wed, 11 May 2011 14:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=wtnQZJFZG73m4HWc4bRIli0OKi5G5IzEZT5JbF+vSqE=; b=nfZAsGwv2XGbiQ/EmQdx08470H9sbUWLsIBrGMTXyHSf3cv+9/WZi/401KPlXAkQDH oMPu99zy2tUASt20ARde1r8ocvzZh+zdmrMc0ETCXzbt+VNPuNJPG1isDxR0HfQLB5Rj XrK1MCJKetYKJSuKxfrOfuMZgc8OnrnXu5anY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=rRScnNV0FR++wXxZxGxCuLknKBKrzMEAfg0xbjVDW92zgDGoKJcLPvcvn2zgGpW33n YabE4j1FyDcSDT8Zz/oIvGfuo86b6ZwTagPz3wiMJS6NeZnWcodYFzYREw2wHBuZlTwQ IyO4s2kxxHMatZEgLg9Mm4t1XwxQreQqc6a4g= Received: by 10.216.221.158 with SMTP id r30mr964195wep.50.1305149158380; Wed, 11 May 2011 14:25:58 -0700 (PDT) Received: from [10.150.51.212] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id t11sm297808wes.41.2011.05.11.14.25.57 (version=SSLv3 cipher=OTHER); Wed, 11 May 2011 14:25:57 -0700 (PDT) Subject: [PATCH] input: remove useless synchronize_rcu() calls From: Eric Dumazet To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel , "Paul E. McKenney" Date: Wed, 11 May 2011 23:25:55 +0200 Message-ID: <1305149155.3232.11.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 11 May 2011 21:26:03 +0000 (UTC) There is no need to call synchronize_rcu() after a list insertion, or a NULL->ptr assignment. However, the reverse operations do need this call. Signed-off-by: Eric Dumazet CC: Paul E. McKenney , --- drivers/input/evdev.c | 2 -- drivers/input/input.c | 1 - drivers/input/joydev.c | 1 - drivers/input/mousedev.c | 1 - 4 files changed, 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 88d8e4c..c00e751 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -159,7 +159,6 @@ static int evdev_grab(struct evdev *evdev, struct evdev_client *client) return error; rcu_assign_pointer(evdev->grab, client); - synchronize_rcu(); return 0; } @@ -182,7 +181,6 @@ static void evdev_attach_client(struct evdev *evdev, spin_lock(&evdev->client_lock); list_add_tail_rcu(&client->node, &evdev->client_list); spin_unlock(&evdev->client_lock); - synchronize_rcu(); } static void evdev_detach_client(struct evdev *evdev, diff --git a/drivers/input/input.c b/drivers/input/input.c index ebbceed..75e11c7 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -451,7 +451,6 @@ int input_grab_device(struct input_handle *handle) } rcu_assign_pointer(dev->grab, handle); - synchronize_rcu(); out: mutex_unlock(&dev->mutex); diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 5688b5c..c24ec2d 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -180,7 +180,6 @@ static void joydev_attach_client(struct joydev *joydev, spin_lock(&joydev->client_lock); list_add_tail_rcu(&client->node, &joydev->client_list); spin_unlock(&joydev->client_lock); - synchronize_rcu(); } static void joydev_detach_client(struct joydev *joydev, diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 7630273..257e033 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -508,7 +508,6 @@ static void mousedev_attach_client(struct mousedev *mousedev, spin_lock(&mousedev->client_lock); list_add_tail_rcu(&client->node, &mousedev->client_list); spin_unlock(&mousedev->client_lock); - synchronize_rcu(); } static void mousedev_detach_client(struct mousedev *mousedev,