From patchwork Fri Nov 11 12:26:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 9422941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2930601C0 for ; Fri, 11 Nov 2016 12:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D597529A96 for ; Fri, 11 Nov 2016 12:27:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C92B729A99; Fri, 11 Nov 2016 12:27:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86F0929A96 for ; Fri, 11 Nov 2016 12:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756254AbcKKM1C (ORCPT ); Fri, 11 Nov 2016 07:27:02 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35444 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbcKKM1A (ORCPT ); Fri, 11 Nov 2016 07:27:00 -0500 Received: by mail-pf0-f196.google.com with SMTP id i88so2461418pfk.2; Fri, 11 Nov 2016 04:27:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YsXZcu2srLJ9QxiyEFbikBAk0UmWdDe/+Ub1Mb7DpBQ=; b=deO+1efzZhWcAjppECAJK79Pp+4VsmU7hRbnrjFtpiuUWeHHW7Mi4Xn8JszaJ0gQtS wIHbOoWN0YcXbcPAyQJpznWOzndesQ8ut8JPb4j8qPFy2HqZAVV6ssfZOOB4Dm3Z3MHR h/ib42W8HfpcbV8/ORkDItEL0ci+v3/duGGwAUwdWQK8qnsfVV/Ul0yAceUXkrrIfO+t LhLIsXGRvDD2hiQNDMLs/0mtZRqK+2H3LgsUZU9q72rWU7rxvGYfS/bl66wOqc2SuPIg XScUesQEZ5kbLAw/k/oytVuijo1smEWlEZ+x8X8oso4KB/HRhEQWaO3DqIpGt0TRnfO3 Mt4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YsXZcu2srLJ9QxiyEFbikBAk0UmWdDe/+Ub1Mb7DpBQ=; b=NXspe9EQbX1RPk2jBiJUzlrjMwoIAhAFwtpp2b3ggtOZR1kpzFlfzBV3eXi+pd9QSn rizcq1gAoryJZodjZcXQZnqChV5a4tR5kqioexvrkgqHQR5CsemBvCDudqHpBOv29hu4 B2zw9pOyDNzfqWPrJ1KcFn05y1I7asxLu0hhv7Mt63jeqWpSQAeEMU0KXEmPpFgSZxfI fL2qVF3vd7DEIopzkq66coBLTrVKSJLIZQiS0K5JBvqRvL0ZxjKuDsd1tVmYhM7aQf2w jrR0iWhYd/2z7Z3/5k+67yu+1mPEi+2ACCnxWVvLuwkqDKDwcHf2dhVVMaBFWxZDXXSg 6eMQ== X-Gm-Message-State: ABUngvc3epQMomPiIMMvYdqMyhcRZLeP7KAyx34hhPq0HyDmN1xsdNDxx48lQS/vQGnDyg== X-Received: by 10.99.99.195 with SMTP id x186mr4449607pgb.100.1478867219764; Fri, 11 Nov 2016 04:26:59 -0800 (PST) Received: from localhost (static-ip-3-79-134-202.rev.dyxnet.com. [202.134.79.3]) by smtp.gmail.com with ESMTPSA id v6sm14910287paz.45.2016.11.11.04.26.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Nov 2016 04:26:59 -0800 (PST) From: Geliang Tang To: Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires Cc: Geliang Tang , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: intel_ish-hid: use list_move_tail in ishtp_cl_read_start Date: Fri, 11 Nov 2016 20:26:42 +0800 Message-Id: <3bdae868a5ebd999c5610f5b19e6a085c51db059.1478858760.git.geliangtang@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use list_move() instead of list_del() + list_add_tail() to simplify the code. Signed-off-by: Geliang Tang --- drivers/hid/intel-ish-hid/ishtp/client.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ishtp/client.c b/drivers/hid/intel-ish-hid/ishtp/client.c index aad6132..0979e04 100644 --- a/drivers/hid/intel-ish-hid/ishtp/client.c +++ b/drivers/hid/intel-ish-hid/ishtp/client.c @@ -497,12 +497,8 @@ int ishtp_cl_read_start(struct ishtp_cl *cl) out: /* if ishtp_hbm_cl_flow_control_req failed, return rb to free list */ if (rets && rb) { - spin_lock_irqsave(&dev->read_list_spinlock, dev_flags); - list_del(&rb->list); - spin_unlock_irqrestore(&dev->read_list_spinlock, dev_flags); - spin_lock_irqsave(&cl->free_list_spinlock, flags); - list_add_tail(&rb->list, &cl->free_rb_list.list); + list_move_tail(&rb->list, &cl->free_rb_list.list); spin_unlock_irqrestore(&cl->free_list_spinlock, flags); } return rets;