Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: changes for code maintainability #15480

Closed
wants to merge 1 commit into from

Conversation

sri-mohan1
Copy link
Contributor

these changes are for improving the code maintainability and readability

@frrbot frrbot bot added the zebra label Mar 5, 2024
@sri-mohan1 sri-mohan1 marked this pull request as draft March 5, 2024 07:18
@sri-mohan1 sri-mohan1 changed the title zebra: changes for code maintainability zebra: changes for code maintainability [draft] Mar 5, 2024
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <[email protected]>
Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick look, and clang-format has many disagreements. Can you check that?

@@ -175,8 +175,7 @@ void zebra_evpn_install_neigh_hash(struct hash_bucket *bucket, void *ctxt)
n = (struct zebra_neigh *)bucket->data;

if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE))
zebra_evpn_rem_neigh_install(wctx->zevpn, n,
false /*was_static*/);
zebra_evpn_rem_neigh_install(wctx->zevpn, n, false /*was_static*/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format disagrees?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mjstapp , Thanks for your time in reviewing the changes.
In many places the clang-format is not proper, for example in the above code snippet the params can be includuded in the same line but it got devided and giving in multiple lines. Am just trying to correct this only on the places where can be corrected, remaining all other places am keeping as it is. thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue will be that we're using clang-format and our config file for it as a reference for now. Diverging from it, other than for a couple of well-known patterns such as cli definition blocks, is going to be confusing.

old_static = zebra_evpn_mac_is_static(mac);
++mac->sync_neigh_cnt;
new_static = zebra_evpn_mac_is_static(mac);
if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH)
zlog_debug(
"sync-neigh ref mac vni %u ip %pIA mac %pEA ref %d",
n->zevpn->vni, &n->ip, &n->emac,
mac->sync_neigh_cnt);
n->zevpn->vni, &n->ip, &n->emac, mac->sync_neigh_cnt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format disagrees?

@sri-mohan1 sri-mohan1 marked this pull request as ready for review March 7, 2024 11:31
@sri-mohan1 sri-mohan1 changed the title zebra: changes for code maintainability [draft] zebra: changes for code maintainability Mar 7, 2024
@sri-mohan1
Copy link
Contributor Author

ci:rerun

Copy link

@Mahesh-Pature Mahesh-Pature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sri-mohan1
Copy link
Contributor Author

ci:rerun

@mjstapp
Copy link
Contributor

mjstapp commented Mar 25, 2024

Please stop re-running CI on these changes - we can't merge these changes until clang-format is clean (in general)

@sri-mohan1
Copy link
Contributor Author

Changes may not be useful.

@sri-mohan1 sri-mohan1 closed this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants