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 <[email protected]>
> ---
>  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;

Reply via email to