Re: [PATCH] HID: intel_ish-hid: use list_move_tail in ishtp_cl_read_start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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;
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux