Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/surface: aggregator: Use list_move_tail instead of list_del/list_add_tail in ssh_packet_layer.c

Using list_move_tail() instead of list_del() + list_add_tail() in ssh_packet_layer.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210609072448.1357524-1-libaokun1@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Baokun Li and committed by
Hans de Goede
be9c4fa2 a8aedd45

+3 -7
+3 -7
drivers/platform/surface/aggregator/ssh_packet_layer.c
··· 1567 1567 clear_bit(SSH_PACKET_SF_PENDING_BIT, &p->state); 1568 1568 1569 1569 atomic_dec(&ptl->pending.count); 1570 - list_del(&p->pending_node); 1571 - 1572 - list_add_tail(&p->pending_node, &claimed); 1570 + list_move_tail(&p->pending_node, &claimed); 1573 1571 } 1574 1572 1575 1573 spin_unlock(&ptl->pending.lock); ··· 1955 1957 smp_mb__before_atomic(); 1956 1958 clear_bit(SSH_PACKET_SF_QUEUED_BIT, &p->state); 1957 1959 1958 - list_del(&p->queue_node); 1959 - list_add_tail(&p->queue_node, &complete_q); 1960 + list_move_tail(&p->queue_node, &complete_q); 1960 1961 } 1961 1962 spin_unlock(&ptl->queue.lock); 1962 1963 ··· 1967 1970 smp_mb__before_atomic(); 1968 1971 clear_bit(SSH_PACKET_SF_PENDING_BIT, &p->state); 1969 1972 1970 - list_del(&p->pending_node); 1971 - list_add_tail(&p->pending_node, &complete_q); 1973 + list_move_tail(&p->pending_node, &complete_q); 1972 1974 } 1973 1975 atomic_set(&ptl->pending.count, 0); 1974 1976 spin_unlock(&ptl->pending.lock);