mirror of
https://github.com/openvswitch/ovs
synced 2025-09-05 00:35:33 +00:00
list: use short version of safe loops if possible.
Using the SHORT version of the *_SAFE loops makes the code cleaner and less error-prone. So, use the SHORT version and remove the extra variable when possible. In order to be able to use both long and short versions without changing the name of the macro for all the clients, overload the existing name and select the appropriate version depending on the number of arguments. Acked-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
d4566085ed
commit
e9bf5bffb0
@@ -623,9 +623,9 @@ dpdk_mp_full(const struct rte_mempool *mp) OVS_REQUIRES(dpdk_mp_mutex)
|
||||
static void
|
||||
dpdk_mp_sweep(void) OVS_REQUIRES(dpdk_mp_mutex)
|
||||
{
|
||||
struct dpdk_mp *dmp, *next;
|
||||
struct dpdk_mp *dmp;
|
||||
|
||||
LIST_FOR_EACH_SAFE (dmp, next, list_node, &dpdk_mp_list) {
|
||||
LIST_FOR_EACH_SAFE (dmp, list_node, &dpdk_mp_list) {
|
||||
if (!dmp->refcount && dpdk_mp_full(dmp->mp)) {
|
||||
VLOG_DBG("Freeing mempool \"%s\"", dmp->mp->name);
|
||||
ovs_list_remove(&dmp->list_node);
|
||||
|
Reference in New Issue
Block a user