From patchwork Fri Jun 28 16:24:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2800141 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1057BF4A1 for ; Fri, 28 Jun 2013 16:29:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D040D20223 for ; Fri, 28 Jun 2013 16:29:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 089C420218 for ; Fri, 28 Jun 2013 16:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755639Ab3F1Q1M (ORCPT ); Fri, 28 Jun 2013 12:27:12 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:38110 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab3F1Q1L (ORCPT ); Fri, 28 Jun 2013 12:27:11 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so2471891pbc.17 for ; Fri, 28 Jun 2013 09:27:10 -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:x-mailer:in-reply-to:references; bh=lbF+LCd9ZwZcm3O75CDh4r6ddBmcJPdP7N66Pg2c8qw=; b=WcmBU6Aav/09ht3D/H74eWfa4Jh1jIo9LtUQOZ8XeWXUzrk7BNQSM0T4c8pJB6xc8Q h/aecH/KHAqWW7uQY0G154hdgpEUYA6atNT7nbIxqPEwXRUNUFqyLjTVN5I+aKbcSKOd 09IZtxcQkMYNBtbKzBTSjroaNnahhBVePLpnEzGR40kmaOnSun2S4mu3jMo80xZ+kYxK qudILSPkzcNVpl9uRGHvsjJYXxBedSQW+pyrfE9kYQ0YUcxa/k8BH1knBzPRYMAIR5jA kRpGaNGJjJTzt2mwDxCx4iXMb9otumIQwCm2vnE65y+O6/zMP5iuLntfv86Mg5RVwkDw h09Q== X-Received: by 10.68.14.170 with SMTP id q10mr12255197pbc.102.1372436830519; Fri, 28 Jun 2013 09:27:10 -0700 (PDT) Received: from localhost.localdomain ([114.250.94.88]) by mx.google.com with ESMTPSA id jf4sm8827948pbb.19.2013.06.28.09.27.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Jun 2013 09:27:09 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" Cc: liuj97@gmail.com, Jiang Liu , Yijing Wang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH v3 02/10] ACPI, DOCK: kill redundant spin lock in dock station object Date: Sat, 29 Jun 2013 00:24:35 +0800 Message-Id: <1372436683-31711-3-git-send-email-liuj97@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1372436683-31711-1-git-send-email-liuj97@gmail.com> References: <1372436683-31711-1-git-send-email-liuj97@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.1 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=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 From: Jiang Liu All dock station objects are created during initialization and don't change at runtime, so kill the redundant spin lock in dock station object. Signed-off-by: Jiang Liu Cc: Len Brown Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/acpi/dock.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index e944e39..a73571f 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -63,7 +63,6 @@ struct dock_station { acpi_handle handle; unsigned long last_dock_time; u32 flags; - spinlock_t dd_lock; struct mutex hp_lock; struct list_head dependent_devices; @@ -112,10 +111,7 @@ add_dock_dependent_device(struct dock_station *ds, acpi_handle handle) dd->handle = handle; INIT_LIST_HEAD(&dd->list); - - spin_lock(&ds->dd_lock); list_add_tail(&dd->list, &ds->dependent_devices); - spin_unlock(&ds->dd_lock); return 0; } @@ -220,14 +216,10 @@ find_dock_dependent_device(struct dock_station *ds, acpi_handle handle) { struct dock_dependent_device *dd; - spin_lock(&ds->dd_lock); - list_for_each_entry(dd, &ds->dependent_devices, list) { - if (handle == dd->handle) { - spin_unlock(&ds->dd_lock); + list_for_each_entry(dd, &ds->dependent_devices, list) + if (handle == dd->handle) return dd; - } - } - spin_unlock(&ds->dd_lock); + return NULL; } @@ -1005,7 +997,6 @@ static int __init dock_add(acpi_handle handle) dock_station->last_dock_time = jiffies - HZ; mutex_init(&dock_station->hp_lock); - spin_lock_init(&dock_station->dd_lock); INIT_LIST_HEAD(&dock_station->sibling); INIT_LIST_HEAD(&dock_station->dependent_devices);