]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: changes for code maintainability 15552/head
authorsri-mohan1 <sri.mohan@samsung.com>
Thu, 14 Mar 2024 09:04:31 +0000 (14:34 +0530)
committersri-mohan1 <sri.mohan@samsung.com>
Fri, 15 Mar 2024 05:00:23 +0000 (10:30 +0530)
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
zebra/zebra_dplane.c
zebra/zebra_mpls.c

index 99693a5874039e4a0643f8aa37b9e687a56af17e..006ab504efa2e03b5f681e77653cb46dde61f184 100644 (file)
@@ -6351,7 +6351,7 @@ dplane_provider_dequeue_out_ctx(struct zebra_dplane_provider *prov)
  */
 bool dplane_provider_is_threaded(const struct zebra_dplane_provider *prov)
 {
-       return (prov->dp_flags & DPLANE_PROV_FLAG_THREADED);
+       return CHECK_FLAG(prov->dp_flags, DPLANE_PROV_FLAG_THREADED);
 }
 
 #ifdef HAVE_NETLINK
index 15e36acda8c3b1308eb483af6cde65721d7cbb6d..90695261eb30ca4e770fbe1a4611047c3513aff8 100644 (file)
@@ -329,7 +329,7 @@ static void fec_evaluate(struct zebra_vrf *zvrf)
 
                        /* Skip configured FECs and those without a label index.
                         */
-                       if (fec->flags & FEC_FLAG_CONFIGURED
+                       if (CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED)
                            || fec->label_index == MPLS_INVALID_LABEL_INDEX)
                                continue;
 
@@ -2420,7 +2420,7 @@ static int zebra_mpls_cleanup_fecs_for_client(struct zserv *client)
                                if (fec_client == client) {
                                        listnode_delete(fec->client_list,
                                                        fec_client);
-                                       if (!(fec->flags & FEC_FLAG_CONFIGURED)
+                                       if (!CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED)
                                            && list_isempty(fec->client_list))
                                                fec_del(fec);
                                        break;
@@ -2538,7 +2538,7 @@ int zebra_mpls_static_fec_add(struct zebra_vrf *zvrf, struct prefix *p,
                if (IS_ZEBRA_DEBUG_MPLS)
                        zlog_debug("Add fec %pFX label %u", p, in_label);
        } else {
-               fec->flags |= FEC_FLAG_CONFIGURED;
+               SET_FLAG(fec->flags, FEC_FLAG_CONFIGURED);
                if (fec->label == in_label)
                        /* Duplicate config */
                        return 0;
@@ -2587,7 +2587,7 @@ int zebra_mpls_static_fec_del(struct zebra_vrf *zvrf, struct prefix *p)
        }
 
        old_label = fec->label;
-       fec->flags &= ~FEC_FLAG_CONFIGURED;
+       UNSET_FLAG(fec->flags, FEC_FLAG_CONFIGURED);
        fec->label = MPLS_INVALID_LABEL;
 
        /* If no client exists, just delete the FEC. */
@@ -2630,7 +2630,7 @@ int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf)
                        char lstr[BUFSIZ];
                        fec = rn->info;
 
-                       if (!(fec->flags & FEC_FLAG_CONFIGURED))
+                       if (!CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED))
                                continue;
 
                        write = 1;