aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2019-06-10 22:23:11 -0400
committerDamjan Marion <dmarion@me.com>2019-06-12 08:17:10 +0000
commit91c512913698ebe182c8da1d5d409f42a28dda3b (patch)
tree7983d6aaf05170a9f3d218f8d3ee43fb49aad209 /src/plugins/lacp
parent16ad61735efbf3f9933fdb9ef7987606ef060cfc (diff)
lacp: cleanup unnecessary pointer cast
Change-Id: Idc3a7588dc73e7180a15b6ace3684d3c12986b9d Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Diffstat (limited to 'src/plugins/lacp')
-rw-r--r--src/plugins/lacp/mux_machine.c19
-rw-r--r--src/plugins/lacp/node.h12
-rw-r--r--src/plugins/lacp/ptx_machine.c19
-rw-r--r--src/plugins/lacp/rx_machine.c27
-rw-r--r--src/plugins/lacp/tx_machine.c7
5 files changed, 38 insertions, 46 deletions
diff --git a/src/plugins/lacp/mux_machine.c b/src/plugins/lacp/mux_machine.c
index 9c7cf746660..2dba60f5f9a 100644
--- a/src/plugins/lacp/mux_machine.c
+++ b/src/plugins/lacp/mux_machine.c
@@ -96,8 +96,8 @@ lacp_attach_mux_to_aggregator (vlib_main_t * vm, slave_if_t * sif)
int
lacp_mux_action_detached (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
lacp_detach_mux_from_aggregator (vm, sif);
@@ -121,8 +121,8 @@ lacp_mux_action_detached (void *p1, void *p2)
int
lacp_mux_action_attached (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
lacp_attach_mux_to_aggregator (vm, sif);
@@ -147,8 +147,8 @@ lacp_mux_action_attached (void *p1, void *p2)
int
lacp_mux_action_waiting (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
if (!lacp_timer_is_running (sif->wait_while_timer))
@@ -169,8 +169,8 @@ lacp_mux_action_waiting (void *p1, void *p2)
int
lacp_mux_action_collecting_distributing (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
sif->actor.state |= LACP_STATE_SYNCHRONIZATION | LACP_STATE_COLLECTING |
@@ -198,8 +198,7 @@ format_mux_event (u8 * s, va_list * args)
{.str = NULL}
};
int e = va_arg (*args, int);
- lacp_event_struct *event_entry =
- (lacp_event_struct *) & lacp_mux_event_array;
+ lacp_event_struct *event_entry = lacp_mux_event_array;
if (e >= (sizeof (lacp_mux_event_array) / sizeof (*event_entry)))
s = format (s, "Bad event %d", e);
diff --git a/src/plugins/lacp/node.h b/src/plugins/lacp/node.h
index 8bc7cf9329c..59af66f20d0 100644
--- a/src/plugins/lacp/node.h
+++ b/src/plugins/lacp/node.h
@@ -186,8 +186,7 @@ format_rx_sm_state (u8 * s, va_list * args)
{.str = NULL}
};
int state = va_arg (*args, int);
- lacp_state_struct *state_entry =
- (lacp_state_struct *) & lacp_rx_sm_state_array;
+ lacp_state_struct *state_entry = lacp_rx_sm_state_array;
if (state >= (sizeof (lacp_rx_sm_state_array) / sizeof (*state_entry)))
s = format (s, "Bad state %d", state);
@@ -207,8 +206,7 @@ format_tx_sm_state (u8 * s, va_list * args)
{.str = NULL}
};
int state = va_arg (*args, int);
- lacp_state_struct *state_entry =
- (lacp_state_struct *) & lacp_tx_sm_state_array;
+ lacp_state_struct *state_entry = lacp_tx_sm_state_array;
if (state >= (sizeof (lacp_tx_sm_state_array) / sizeof (*state_entry)))
s = format (s, "Bad state %d", state);
@@ -228,8 +226,7 @@ format_mux_sm_state (u8 * s, va_list * args)
{.str = NULL}
};
int state = va_arg (*args, int);
- lacp_state_struct *state_entry =
- (lacp_state_struct *) & lacp_mux_sm_state_array;
+ lacp_state_struct *state_entry = lacp_mux_sm_state_array;
if (state >= (sizeof (lacp_mux_sm_state_array) / sizeof (*state_entry)))
s = format (s, "Bad state %d", state);
@@ -249,8 +246,7 @@ format_ptx_sm_state (u8 * s, va_list * args)
{.str = NULL}
};
int state = va_arg (*args, int);
- lacp_state_struct *state_entry =
- (lacp_state_struct *) & lacp_ptx_sm_state_array;
+ lacp_state_struct *state_entry = lacp_ptx_sm_state_array;
if (state >= (sizeof (lacp_ptx_sm_state_array) / sizeof (*state_entry)))
s = format (s, "Bad state %d", state);
diff --git a/src/plugins/lacp/ptx_machine.c b/src/plugins/lacp/ptx_machine.c
index 7e604cc489d..b933a87e759 100644
--- a/src/plugins/lacp/ptx_machine.c
+++ b/src/plugins/lacp/ptx_machine.c
@@ -74,8 +74,8 @@ lacp_machine_t lacp_ptx_machine = {
int
lacp_ptx_action_no_periodic (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_stop_timer (&sif->periodic_timer);
lacp_ptx_post_short_timeout_event (vm, sif);
@@ -85,8 +85,8 @@ lacp_ptx_action_no_periodic (void *p1, void *p2)
int
lacp_ptx_action_slow_periodic (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
u8 timer_expired;
lacp_main_t *lm = &lacp_main;
@@ -115,8 +115,8 @@ lacp_ptx_action_slow_periodic (void *p1, void *p2)
int
lacp_ptx_action_fast_periodic (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
u8 timer_expired;
lacp_main_t *lm = &lacp_main;
@@ -150,8 +150,8 @@ lacp_ptx_action_fast_periodic (void *p1, void *p2)
int
lacp_ptx_action_timer_expired (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
if (!(sif->partner.state & LACP_STATE_LACP_ACTIVITY) &&
!(sif->actor.state & LACP_STATE_LACP_ACTIVITY))
@@ -183,8 +183,7 @@ format_ptx_event (u8 * s, va_list * args)
{.str = NULL}
};
int e = va_arg (*args, int);
- lacp_event_struct *event_entry =
- (lacp_event_struct *) & lacp_ptx_event_array;
+ lacp_event_struct *event_entry = lacp_ptx_event_array;
if (e >= (sizeof (lacp_ptx_event_array) / sizeof (*event_entry)))
s = format (s, "Bad event %d", e);
diff --git a/src/plugins/lacp/rx_machine.c b/src/plugins/lacp/rx_machine.c
index 070b9089cd2..293cdac846d 100644
--- a/src/plugins/lacp/rx_machine.c
+++ b/src/plugins/lacp/rx_machine.c
@@ -240,8 +240,8 @@ lacp_set_port_moved (vlib_main_t * vm, slave_if_t * sif, u8 val)
int
lacp_rx_action_initialize (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_set_port_unselected (vm, sif);
lacp_record_default (sif);
@@ -257,8 +257,8 @@ lacp_rx_action_initialize (void *p1, void *p2)
int
lacp_rx_action_port_disabled (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
sif->partner.state &= ~LACP_STATE_SYNCHRONIZATION;
if (sif->port_moved)
@@ -282,8 +282,8 @@ lacp_rx_action_port_disabled (void *p1, void *p2)
int
lacp_rx_action_expired (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
u8 timer_expired;
lacp_main_t *lm = &lacp_main;
@@ -310,8 +310,8 @@ lacp_rx_action_expired (void *p1, void *p2)
int
lacp_rx_action_lacp_disabled (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_set_port_unselected (vm, sif);
lacp_record_default (sif);
@@ -324,8 +324,8 @@ lacp_rx_action_lacp_disabled (void *p1, void *p2)
int
lacp_rx_action_defaulted (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_stop_timer (&sif->current_while_timer);
lacp_update_default_selected (vm, sif);
@@ -363,8 +363,8 @@ lacp_port_is_moved (vlib_main_t * vm, slave_if_t * sif)
int
lacp_rx_action_current (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
lacp_update_selected (vm, sif);
@@ -389,8 +389,7 @@ format_rx_event (u8 * s, va_list * args)
{.str = NULL}
};
int e = va_arg (*args, int);
- lacp_event_struct *event_entry =
- (lacp_event_struct *) & lacp_rx_event_array;
+ lacp_event_struct *event_entry = lacp_rx_event_array;
if (e >= (sizeof (lacp_rx_event_array) / sizeof (*event_entry)))
s = format (s, "Bad event %d", e);
diff --git a/src/plugins/lacp/tx_machine.c b/src/plugins/lacp/tx_machine.c
index 4cc4e68a103..b252485d73c 100644
--- a/src/plugins/lacp/tx_machine.c
+++ b/src/plugins/lacp/tx_machine.c
@@ -38,8 +38,8 @@ lacp_machine_t lacp_tx_machine = {
int
lacp_tx_action_transmit (void *p1, void *p2)
{
- vlib_main_t *vm = (vlib_main_t *) p1;
- slave_if_t *sif = (slave_if_t *) p2;
+ vlib_main_t *vm = p1;
+ slave_if_t *sif = p2;
lacp_main_t *lm = &lacp_main;
f64 now = vlib_time_now (lm->vlib_main);
@@ -70,8 +70,7 @@ format_tx_event (u8 * s, va_list * args)
{.str = NULL}
};
int e = va_arg (*args, int);
- lacp_event_struct *event_entry =
- (lacp_event_struct *) & lacp_tx_event_array;
+ lacp_event_struct *event_entry = lacp_tx_event_array;
if (e >= (sizeof (lacp_tx_event_array) / sizeof (*event_entry)))
s = format (s, "Bad event %d", e);