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_request_layer.c

Using list_move_tail() instead of list_del() + list_add_tail() in ssh_request_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/20210609072638.1358174-1-libaokun1@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Baokun Li and committed by
Hans de Goede
a8aedd45 f9e7f9a2

+3 -7
+3 -7
drivers/platform/surface/aggregator/ssh_request_layer.c
··· 863 863 clear_bit(SSH_REQUEST_SF_PENDING_BIT, &r->state); 864 864 865 865 atomic_dec(&rtl->pending.count); 866 - list_del(&r->node); 867 - 868 - list_add_tail(&r->node, &claimed); 866 + list_move_tail(&r->node, &claimed); 869 867 } 870 868 spin_unlock(&rtl->pending.lock); 871 869 ··· 1202 1204 smp_mb__before_atomic(); 1203 1205 clear_bit(SSH_REQUEST_SF_QUEUED_BIT, &r->state); 1204 1206 1205 - list_del(&r->node); 1206 - list_add_tail(&r->node, &claimed); 1207 + list_move_tail(&r->node, &claimed); 1207 1208 } 1208 1209 spin_unlock(&rtl->queue.lock); 1209 1210 ··· 1235 1238 smp_mb__before_atomic(); 1236 1239 clear_bit(SSH_REQUEST_SF_PENDING_BIT, &r->state); 1237 1240 1238 - list_del(&r->node); 1239 - list_add_tail(&r->node, &claimed); 1241 + list_move_tail(&r->node, &claimed); 1240 1242 } 1241 1243 spin_unlock(&rtl->pending.lock); 1242 1244 }