Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1612542imu; Tue, 6 Nov 2018 01:14:00 -0800 (PST) X-Google-Smtp-Source: AJdET5d5dFFRS3H5zw5F9whA5u+NQURPjoZvUyoyPiWIj8HjVR+Q9Em47YJMwIxvzSl4kn1Hsfg2 X-Received: by 2002:a63:480d:: with SMTP id v13-v6mr22967291pga.308.1541495640637; Tue, 06 Nov 2018 01:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541495640; cv=none; d=google.com; s=arc-20160816; b=wvt3i0LzSJ78GNZL51TwU4VWWVO28I3+/SH/vXv2wyi/3hp0v23OYrjcrwxxXcQZ0x ZdEgkBphMrz/ofaddoHzsVwpH8ydaojMfyQWguRPKnhP56Opw25IVV7seocd1RWKUsrq akPVx50AP+TQ+gbnrjBJdYPOJACgqcHoRPR0VHSGYRoQcF5+RwOWeDJfN2+nS+XimpuG ZnUHhitgSEON5yHFm6IWijV9GlmiGsDYvBGDcUwWBKsiBRLF0KsWyrT03cQ1kZ1PmCvK SXFUuV5/oOCi/hbGUvAqHamQ3wXNdScJ9zJ9PTjqPD4l3zw6L06t2rYbpO7DefA5/QCL lvGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ETeLdANTwA1PXljPkVbl8bHnIaB2c5SAi8EMxRi2Zd0=; b=wVgcXbwwayFX0ZVeujU6mb96sIiN9defD9gbMTfspZTipbsWYimsWwF8emFSy9Nhx8 f8G9rBRWQasM9QbvOXKpAAGE5MvV6y+c09iz539wcwfa+KfSOUyxB/clE9TZvOsKG+hy bBEYL209vwQrFrFUpz1egihRA6eDHa8HHYsXMhZ6ZkHsXyuGXVR15ikvJ1jFwC2TySE/ hFDmIK2UL+leWAlVp5EC1aaHZiRTSgoVczxszZGYjnqu24ekxYTqpzXUTQVxgS0xRNyh NS4zx4qIIAure2vWzpDzsmi0/Xpm4b2/LTRzK65ZAN5AkqHLUAhAkT0YPQQMTmZ2zZ2m DKZA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11-v6si44564062pfh.33.2018.11.06.01.13.45; Tue, 06 Nov 2018 01:14:00 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730335AbeKFSg7 (ORCPT + 99 others); Tue, 6 Nov 2018 13:36:59 -0500 Received: from mga05.intel.com ([192.55.52.43]:26399 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbeKFSg7 (ORCPT ); Tue, 6 Nov 2018 13:36:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 01:12:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,471,1534834800"; d="scan'208";a="83674060" Received: from twinkler-lnx.jer.intel.com ([10.12.91.48]) by fmsmga007.fm.intel.com with ESMTP; 06 Nov 2018 01:12:42 -0800 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, Tomas Winkler Subject: [char-misc-next 2/3] mei: flush queues by the host client only Date: Tue, 6 Nov 2018 12:04:39 +0200 Message-Id: <20181106100440.2140-2-tomas.winkler@intel.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181106100440.2140-1-tomas.winkler@intel.com> References: <20181106100440.2140-1-tomas.winkler@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin During queues flush, the me client in most cases is already unlinked hence the me client id is unavailable. The host client structure pointer is enough for identification. The function mei_cl_cmp_id() is dropped as it has no more usage. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index ebdcf0b450e2..ee58561ceb08 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -317,23 +317,6 @@ void mei_me_cl_rm_all(struct mei_device *dev) up_write(&dev->me_clients_rwsem); } -/** - * mei_cl_cmp_id - tells if the clients are the same - * - * @cl1: host client 1 - * @cl2: host client 2 - * - * Return: true - if the clients has same host and me ids - * false - otherwise - */ -static inline bool mei_cl_cmp_id(const struct mei_cl *cl1, - const struct mei_cl *cl2) -{ - return cl1 && cl2 && - (cl1->host_client_id == cl2->host_client_id) && - (mei_cl_me_id(cl1) == mei_cl_me_id(cl2)); -} - /** * mei_io_cb_free - free mei_cb_private related memory * @@ -418,7 +401,7 @@ static void mei_io_list_flush_cl(struct list_head *head, struct mei_cl_cb *cb, *next; list_for_each_entry_safe(cb, next, head, list) { - if (mei_cl_cmp_id(cl, cb->cl)) + if (cl == cb->cl) list_del_init(&cb->list); } } @@ -435,7 +418,7 @@ static void mei_io_tx_list_free_cl(struct list_head *head, struct mei_cl_cb *cb, *next; list_for_each_entry_safe(cb, next, head, list) { - if (mei_cl_cmp_id(cl, cb->cl)) + if (cl == cb->cl) mei_tx_cb_dequeue(cb); } } -- 2.14.5