Skip to content

Commit fb95b84

Browse files
committed
[vpp]: Fix -Werror warnings in sub-port commits
* Remove unused hwif_name variable * Zero-initialize bond_info to silence -Wmaybe-uninitialized Signed-off-by: Bojun-Feng <bojundf@gmail.com>
1 parent 2f64eb8 commit fb95b84

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

vslib/vpp/SwitchVppRif.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ sai_status_t SwitchVpp::vpp_create_router_interface(
15831583

15841584
std::string if_name;
15851585
bool found = false;
1586-
platform_bond_info_t bond_info;
1586+
platform_bond_info_t bond_info = {};
15871587
if (ot == SAI_OBJECT_TYPE_LAG) {
15881588
CHECK_STATUS(get_lag_bond_info(obj_id, bond_info));
15891589
if_name = std::string(PORTCHANNEL_PREFIX) + std::to_string(bond_info.id);
@@ -1782,7 +1782,7 @@ sai_status_t SwitchVpp::vpp_router_interface_remove_vrf(
17821782

17831783
std::string if_name;
17841784
bool found = false;
1785-
platform_bond_info_t bond_info;
1785+
platform_bond_info_t bond_info = {};
17861786
if (objectTypeQuery(obj_id) == SAI_OBJECT_TYPE_LAG) {
17871787
CHECK_STATUS(get_lag_bond_info(obj_id, bond_info));
17881788
if_name = std::string(PORTCHANNEL_PREFIX) + std::to_string(bond_info.id);
@@ -1889,7 +1889,7 @@ sai_status_t SwitchVpp::vpp_remove_router_interface(sai_object_id_t rif_id)
18891889
uint16_t vlan_id = attr.value.u16;
18901890

18911891
std::string if_name;
1892-
platform_bond_info_t bond_info;
1892+
platform_bond_info_t bond_info = {};
18931893
bool found;
18941894
if (ot == SAI_OBJECT_TYPE_LAG) {
18951895
status = get_lag_bond_info(obj_id, bond_info);

vslib/vpp/SwitchVppRoute.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ sai_status_t SwitchVpp::IpRouteAddRemove(
137137
next_hop_oid = attr.value.oid;
138138

139139
sai_route_entry_t route_entry;
140-
const char *hwif_name = NULL;
141140
vpp_nexthop_type_e nexthop_type = VPP_NEXTHOP_NORMAL;
142141
bool config_ip_route = false;
143142

0 commit comments

Comments
 (0)