Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp431671ima; Wed, 24 Oct 2018 03:49:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5cmTxAqHky36H23gmhcqfU68Sq2JeHGUKWx5TfnWnSA2Z7Oc+ULiDrRnUGMJuJy0fWgqwi8 X-Received: by 2002:a65:44c6:: with SMTP id g6-v6mr1990123pgs.350.1540378147484; Wed, 24 Oct 2018 03:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540378147; cv=none; d=google.com; s=arc-20160816; b=F0m742emy+leWfxV+W+k55G2rb1EOU/sNjBoUi8zHHpXj4w4Gm4XCcrZ2wvAF1xzHO aWs9m4S5kVjz8WjrCSDxJ6V+aKTCOag38iJNNhXnk87fkTtjji4vYuaEcEUYlRl9jVSu rX5eaEVEwpQHrpMWN4DRryyePVH+W9ySxlc/K8AejLEXMC+AIG7jFGH1pKjLS6f7MxFu LJu5TdsV/rQ4UtLTX//dZe33C0iLXMAC04hhzYmcwju/ovBRIXES0eVujnO1gnoa96Zi S60dDSQE0L7YaPNiLI3tQcEK/fJjmigziF1xyMMM5OjcbW9ZSLWSFX1Rg+311UNZsi61 qBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+2jdHf836N0jlAXC3NKgKeCrs7l764z2sQXr89dOVNA=; b=ZVEr8foXMynmjjWme8KLtoQe0VO3hMqrDzOngbFGhnh0mrydaEAR5p/KmQ+0CFd60X CpR9jPqfsm6MICrZ2ehwon5Ws2HallLDKt+VwT6acxuCcjAAbiiuj3pTy99se0hzC44J p9M6gYu/RGRz+wKaR8FWd0Qu2QIfzdqRspXJ6HUJkyADXH92alkly83ZkmK6jSPicJ2i lv6kChTISpbeLopnSzffGWorC9Irr9eemifv5E1OSlmqSejQUhcBnssrQKmbZzgncu/D H5HK+7/ruLA/+kInhbJIShZYPV/AxVriJNRI1uRA7U1F6Pqhdm3QBxmFyQaAPtoUS2Ap UZ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=jQWj3S94; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14-v6si4192903pfo.118.2018.10.24.03.48.51; Wed, 24 Oct 2018 03:49:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=jQWj3S94; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727141AbeJXTQG (ORCPT + 99 others); Wed, 24 Oct 2018 15:16:06 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35218 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbeJXTQG (ORCPT ); Wed, 24 Oct 2018 15:16:06 -0400 Received: by mail-wr1-f65.google.com with SMTP id w5-v6so5057946wrt.2 for ; Wed, 24 Oct 2018 03:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+2jdHf836N0jlAXC3NKgKeCrs7l764z2sQXr89dOVNA=; b=jQWj3S94vbjykU/bJekq6t9QMJIfpd5meQA2D+nzXlYSvi8/Xe2v1jpf1vujmsn3JG qJsiMyR39NyCtvsdbxAg6AUfJe4emAsj00WqzIsKGXXfQxap7rLX/iy/iddeyhYUSCPM 95bkh59i0/KNHah+b+kd7x1FMEuZVXKxf16zI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+2jdHf836N0jlAXC3NKgKeCrs7l764z2sQXr89dOVNA=; b=WyOms9HP5vSU4k1mr6R/CEDLlQhbgTRv1DmM2AXA67yNba9IezpJXBm2wK65bnN0Ea 0U/Cmsg+J5sKoVLgHdYBj7XjmGgNukdnNHByHWJVPeE0JEHwnJNzmEV9bzapQZ1lBPkS Q2C7USdXiiBsZvSEfeyRDwwAz0FbBV2vzWo4Drsi3ImVwb/d8FgXstAUSo0NFDRv7ZkS ZYm3gsWprC6tbl7Vg0x+rvzVYDXNQQvUVhNDUk/BWQcOdK0/+HCS/77tx7S7q1unK0IL uRaiRGq0gdJjgjhTiSTHbjTRK1qVKm33o1gdxb8HiVYhPCaFfXzSV04QmG69tVy/fZJE fhLQ== X-Gm-Message-State: AGRZ1gKtcmQQIsvXa4jCZgOFz8xvsrxWcMjiqXqKi3fq4tdS9CmKo9wP AvRFWkwJhvoGmgFgLs/BX/j85g== X-Received: by 2002:adf:93e6:: with SMTP id 93-v6mr2287057wrp.81.1540378108594; Wed, 24 Oct 2018 03:48:28 -0700 (PDT) Received: from prevas-ravi.event.pylonone.net ([185.7.230.213]) by smtp.gmail.com with ESMTPSA id 125-v6sm4639814wmm.25.2018.10.24.03.48.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 03:48:28 -0700 (PDT) From: Rasmus Villemoes To: "Bryan O'Donoghue" , Johan Hovold , Alex Elder , Greg Kroah-Hartman Cc: Rasmus Villemoes , greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: greybus: loopback.c: remove unused lists Date: Wed, 24 Oct 2018 11:48:20 +0100 Message-Id: <20181024104820.20298-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.6.gbde171bbf5 In-Reply-To: <20181005142826.26108-1-linux@rasmusvillemoes.dk> References: <20181005142826.26108-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gb_loopback_device::list_op_async is never used except for the LIST_INIT. The ::list field appears to have a few more uses, but on closer inspection the linked list of struct gb_loopbacks that it heads is never used for anything, so there's no reason to maintain it, much less to keep it sorted. Reviewed-by: Bryan O'Donoghue Signed-off-by: Rasmus Villemoes --- Sending as a proper patch. Marked v2 since this replaces earlier 2/3 and 3/3 patches. Applies on top of b4fc4e8340784e000030c5a59bf0791f9c3ce15e (staging: greybus: loopback.c: remove unused gb_loopback::lbid). drivers/staging/greybus/loopback.c | 38 ------------------------------ 1 file changed, 38 deletions(-) diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 7080294f705c..e4d42c1dc284 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -47,8 +47,6 @@ struct gb_loopback_device { /* We need to take a lock in atomic context */ spinlock_t lock; - struct list_head list; - struct list_head list_op_async; wait_queue_head_t wq; }; @@ -68,7 +66,6 @@ struct gb_loopback { struct kfifo kfifo_lat; struct mutex mutex; struct task_struct *task; - struct list_head entry; struct device *dev; wait_queue_head_t wq; wait_queue_head_t wq_completion; @@ -987,37 +984,6 @@ static const struct file_operations gb_loopback_debugfs_latency_ops = { .release = single_release, }; -static int gb_loopback_bus_id_compare(void *priv, struct list_head *lha, - struct list_head *lhb) -{ - struct gb_loopback *a = list_entry(lha, struct gb_loopback, entry); - struct gb_loopback *b = list_entry(lhb, struct gb_loopback, entry); - struct gb_connection *ca = a->connection; - struct gb_connection *cb = b->connection; - - if (ca->bundle->intf->interface_id < cb->bundle->intf->interface_id) - return -1; - if (cb->bundle->intf->interface_id < ca->bundle->intf->interface_id) - return 1; - if (ca->bundle->id < cb->bundle->id) - return -1; - if (cb->bundle->id < ca->bundle->id) - return 1; - if (ca->intf_cport_id < cb->intf_cport_id) - return -1; - else if (cb->intf_cport_id < ca->intf_cport_id) - return 1; - - return 0; -} - -static void gb_loopback_insert_id(struct gb_loopback *gb) -{ - /* perform an insertion sort */ - list_add_tail(&gb->entry, &gb_dev.list); - list_sort(NULL, &gb_dev.list, gb_loopback_bus_id_compare); -} - #define DEBUGFS_NAMELEN 32 static int gb_loopback_probe(struct gb_bundle *bundle, @@ -1113,7 +1079,6 @@ static int gb_loopback_probe(struct gb_bundle *bundle, } spin_lock_irqsave(&gb_dev.lock, flags); - gb_loopback_insert_id(gb); gb_dev.count++; spin_unlock_irqrestore(&gb_dev.lock, flags); @@ -1169,7 +1134,6 @@ static void gb_loopback_disconnect(struct gb_bundle *bundle) spin_lock_irqsave(&gb_dev.lock, flags); gb_dev.count--; - list_del(&gb->entry); spin_unlock_irqrestore(&gb_dev.lock, flags); device_unregister(gb->dev); @@ -1196,8 +1160,6 @@ static int loopback_init(void) { int retval; - INIT_LIST_HEAD(&gb_dev.list); - INIT_LIST_HEAD(&gb_dev.list_op_async); spin_lock_init(&gb_dev.lock); gb_dev.root = debugfs_create_dir("gb_loopback", NULL); -- 2.19.1.6.gbde171bbf5