nfp: use list_move instead of list_del/list_add in nfp_cppcore.c
authorBaokun Li <libaokun1@huawei.com>
Wed, 9 Jun 2021 07:09:21 +0000 (15:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 20:55:37 +0000 (13:55 -0700)
Using list_move() instead of list_del() + list_add() in nfp_cppcore.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c

index 94994a9..d7ac030 100644 (file)
@@ -905,8 +905,7 @@ area_cache_put(struct nfp_cpp *cpp, struct nfp_cpp_area_cache *cache)
                return;
 
        /* Move to front of LRU */
-       list_del(&cache->entry);
-       list_add(&cache->entry, &cpp->area_cache_list);
+       list_move(&cache->entry, &cpp->area_cache_list);
 
        mutex_unlock(&cpp->area_cache_mutex);
 }