From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0DC9D1C0BE0 for ; Tue, 22 Dec 2015 09:55:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 064008409C for ; Tue, 22 Dec 2015 09:55:03 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JNkoA+vr0pZx for ; Tue, 22 Dec 2015 09:54:59 +0000 (UTC) Received: from email.microchip.com (exsmtp03.microchip.com [198.175.253.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8929F8BF47 for ; Tue, 22 Dec 2015 09:54:40 +0000 (UTC) From: Christian Gromm Subject: [PATCH 18/28] staging: most: remove redundant mutexes Date: Tue, 22 Dec 2015 10:52:59 +0100 Message-ID: <1450777989-5551-19-git-send-email-christian.gromm@microchip.com> In-Reply-To: <1450777989-5551-1-git-send-email-christian.gromm@microchip.com> References: <1450777989-5551-1-git-send-email-christian.gromm@microchip.com> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: Christian Gromm , driverdev-devel@linuxdriverproject.org This patch removes the mutexes stop_task_mutex and deregister mutex, since they can safely be left out. Signed-off-by: Christian Gromm --- This patch has been resent on behalf of Greg Kroah-Hartman drivers/staging/most/mostcore/core.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 31ea3a5..b085f0a 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -65,7 +65,6 @@ struct most_c_obj { struct most_c_aim_obj aim1; struct list_head trash_fifo; struct task_struct *hdm_enqueue_task; - struct mutex stop_task_mutex; wait_queue_head_t hdm_fifo_wq; }; @@ -93,8 +92,6 @@ struct most_inst_obj { _mbo; \ }) -static struct mutex deregister_mutex; - /* ___ ___ * ___C H A N N E L___ */ @@ -737,10 +734,8 @@ static void destroy_most_inst_obj(struct most_inst_obj *inst) struct most_c_obj *c, *tmp; list_for_each_entry_safe(c, tmp, &inst->channel_list, list) { - mutex_lock(&deregister_mutex); flush_trash_fifo(c); flush_channel_fifos(c); - mutex_unlock(&deregister_mutex); kobject_put(&c->kobj); } kobject_put(&inst->kobj); @@ -1575,11 +1570,9 @@ int most_stop_channel(struct most_interface *iface, int id, if (c->aim0.refs + c->aim1.refs >= 2) goto out; - mutex_lock(&c->stop_task_mutex); if (c->hdm_enqueue_task) kthread_stop(c->hdm_enqueue_task); c->hdm_enqueue_task = NULL; - mutex_unlock(&c->stop_task_mutex); if (iface->mod) module_put(iface->mod); @@ -1757,7 +1750,6 @@ struct kobject *most_register_interface(struct most_interface *iface) init_completion(&c->cleanup); atomic_set(&c->mbo_ref, 0); mutex_init(&c->start_mutex); - mutex_init(&c->stop_task_mutex); list_add_tail(&c->list, &inst->channel_list); } pr_info("registered new MOST device mdev%d (%s)\n", @@ -1853,7 +1845,6 @@ static int __init most_init(void) pr_info("init()\n"); INIT_LIST_HEAD(&instance_list); INIT_LIST_HEAD(&aim_list); - mutex_init(&deregister_mutex); ida_init(&mdev_id); if (bus_register(&most_bus)) { -- 1.7.9.5 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel