From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Geliang Tang <geliangtang@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: intel_ish-hid: use list_move_tail in ishtp_cl_read_start
Date: Fri, 11 Nov 2016 14:51:20 -0800 [thread overview]
Message-ID: <1478904680.20074.8.camel@linux.intel.com> (raw)
In-Reply-To: <3bdae868a5ebd999c5610f5b19e6a085c51db059.1478858760.git.geliangtang@gmail.com>
On Fri, 2016-11-11 at 20:26 +0800, Geliang Tang wrote:
> Use list_move() instead of list_del() + list_add_tail() to simplify
> the code.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
> 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);
Logically the result is not same. They were protected under two
spinlocks, now they are not.
Thanks,
Srinivas
> spin_unlock_irqrestore(&cl->free_list_spinlock,
> flags);
> }
> return rets;
next prev parent reply other threads:[~2016-11-11 22:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-11 12:26 [PATCH] drm/radeon: use list_move in radeon_vm_bo_update Geliang Tang
2016-11-11 12:26 ` [PATCH] HID: intel_ish-hid: use list_move_tail in ishtp_cl_read_start Geliang Tang
2016-11-11 22:51 ` Srinivas Pandruvada [this message]
2016-11-11 13:46 ` [PATCH] drm/radeon: use list_move in radeon_vm_bo_update Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478904680.20074.8.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=geliangtang@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).