Skip to content

Commit

Permalink
Address clang-tidy issues (ipdk-io#163)
Browse files Browse the repository at this point in the history
- Deal with a couple of unreferenced variables.

- Remove gratuitous parentheses.

Signed-off-by: Derek Foster <derek.foster@intel.com>
  • Loading branch information
ffoulkes authored Oct 7, 2024
1 parent 529a5df commit c96f095
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions switchlink/switchlink_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ switchlink_db_status_t switchlink_db_delete_lag_member(
switchlink_db_lag_member_obj_t* obj = node->data;
krnlmon_assert(obj != NULL);
node = node->next;
if ((obj->lag_member_info.ifindex == lag_member_info->ifindex)) {
if (obj->lag_member_info.ifindex == lag_member_info->ifindex) {
tommy_list_remove_existing(&switchlink_db_lag_member_obj_list,
&obj->list_node);
switchlink_free(obj);
Expand Down Expand Up @@ -1150,7 +1150,7 @@ uint32_t switchlink_db_delete_lacp_member(switchlink_handle_t lag_h) {
switchlink_db_lag_member_obj_t* obj = node->data;
krnlmon_assert(obj != NULL);
node = node->next;
if ((obj->lag_member_info.lag_h == lag_h)) {
if (obj->lag_member_info.lag_h == lag_h) {
return obj->lag_member_info.ifindex;
}
}
Expand All @@ -1176,7 +1176,7 @@ switchlink_db_status_t switchlink_db_update_lag_member_oper_state(
switchlink_db_lag_member_obj_t* obj = node->data;
krnlmon_assert(obj != NULL);
node = node->next;
if ((lag_member_info->ifindex == obj->lag_member_info.ifindex)) {
if (lag_member_info->ifindex == obj->lag_member_info.ifindex) {
obj->lag_member_info.oper_state = lag_member_info->oper_state;
return SWITCHLINK_DB_STATUS_SUCCESS;
}
Expand Down Expand Up @@ -1204,7 +1204,7 @@ switchlink_db_status_t switchlink_db_get_lag_member_info(
switchlink_db_lag_member_obj_t* obj = node->data;
krnlmon_assert(obj != NULL);
node = node->next;
if ((obj->lag_member_info.ifindex == lag_member_info->ifindex)) {
if (obj->lag_member_info.ifindex == lag_member_info->ifindex) {
memcpy(lag_member_info, &(obj->lag_member_info),
sizeof(switchlink_db_lag_member_info_t));
return SWITCHLINK_DB_STATUS_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion switchlink/switchlink_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
struct link_attrs attrs = {0};
#ifdef LAG_OPTION
bool create_lag_member = false;
Expand Down Expand Up @@ -334,6 +333,7 @@ void switchlink_process_link_msg(const struct nlmsghdr* nlmsg, int msgtype) {

#if !defined(OVSP4RT_SUPPORT)
case SWITCHLINK_LINK_TYPE_VXLAN: {
switchlink_db_tunnel_interface_info_t tnl_intf_info = {0};
snprintf(tnl_intf_info.ifname, sizeof(tnl_intf_info.ifname), "%s",
attrs.ifname);
tnl_intf_info.dst_ip = attrs.remote_ip_addr;
Expand Down
5 changes: 0 additions & 5 deletions switchlink/switchlink_neigh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
bridge_h = ifinfo.bridge_h;
krnlmon_assert(bridge_h != 0);
}

if (msgtype == RTM_NEWNEIGH) {
if (ipaddr_valid) {
Expand Down

0 comments on commit c96f095

Please sign in to comment.