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

Address clang-tidy issues #163

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Address clang-tidy issues #163

merged 2 commits into from
Oct 7, 2024

Conversation

ffoulkes
Copy link
Contributor

@ffoulkes ffoulkes commented Oct 2, 2024

  • Deal with a couple of unreferenced variables.

  • Remove gratuitous parentheses.

- Deal with a couple of unreferenced variables.

- Remove gratuitous parentheses.

Signed-off-by: Derek Foster <[email protected]>
@@ -216,7 +216,6 @@ void switchlink_process_link_msg(const struct nlmsghdr* nlmsg, int msgtype) {
int linkinfo_attr_type;

switchlink_db_interface_info_t intf_info = {0};
switchlink_db_tunnel_interface_info_t tnl_intf_info = {0};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unreferenced variable. Moved inside #ifdef block.

@@ -123,11 +123,6 @@ void switchlink_process_neigh_msg(const struct nlmsghdr* nlmsg, int msgtype) {
} else {
intf_h = ifinfo.intf_h;
}
switchlink_handle_t bridge_h = g_default_bridge_h;
if (ifinfo.intf_type == SWITCHLINK_INTF_TYPE_L2_ACCESS) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we removing this block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clang-tidy flagged bridge_h as an unreferenced variable. It's only used in the krnlmon_assert statement, which is disabled unless we build krnlmon in Debug mode. I didn't see this as a compelling reason to preserve what is otherwise dead code.

Copy link
Collaborator

@5abeel 5abeel left a comment

Choose a reason for hiding this comment

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

LGTM

@ffoulkes ffoulkes merged commit c96f095 into main Oct 7, 2024
4 checks passed
@ffoulkes ffoulkes deleted the clang-tidy-fixes branch October 7, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants