diff options
author | Donald Sharp <sharpd@nvidia.com> | 2020-09-24 02:36:51 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2020-09-24 02:36:51 +0200 |
commit | 00e0d113e5ffcb69304b8d5d83f0357ec416c6c4 (patch) | |
tree | 9ca2e586daa4a88b41a1e84ae200a4170bca0b67 | |
parent | Merge pull request #7155 from donaldsharp/TRAP (diff) | |
download | frr-00e0d113e5ffcb69304b8d5d83f0357ec416c6c4.tar.xz frr-00e0d113e5ffcb69304b8d5d83f0357ec416c6c4.zip |
zebra: the mlag_rd_buf_offset variable was write only
The mlag_rd_buf_offset function was only ever being set to 0
in the mlag_read function and only written in that function.
There is no need for this global variable.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r-- | zebra/zebra_mlag.c | 1 | ||||
-rw-r--r-- | zebra/zebra_mlag.h | 2 | ||||
-rw-r--r-- | zebra/zebra_mlag_private.c | 4 |
3 files changed, 1 insertions, 6 deletions
diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c index fb8798ebd..d8ed9b2a3 100644 --- a/zebra/zebra_mlag.c +++ b/zebra/zebra_mlag.c @@ -49,7 +49,6 @@ DEFINE_HOOK(zebra_mlag_private_cleanup_data, (), ()) uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; -uint32_t mlag_rd_buf_offset; static bool test_mlag_in_progress; diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h index 85028d277..b195c75ea 100644 --- a/zebra/zebra_mlag.h +++ b/zebra/zebra_mlag.h @@ -42,12 +42,10 @@ DECLARE_HOOK(zebra_mlag_private_cleanup_data, (), ()) extern uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; -extern uint32_t mlag_rd_buf_offset; static inline void zebra_mlag_reset_read_buffer(void) { memset(mlag_wr_buffer, 0, ZEBRA_MLAG_BUF_LIMIT); - mlag_rd_buf_offset = 0; } enum zebra_mlag_state { diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c index 1dae758b1..9c34aa2c3 100644 --- a/zebra/zebra_mlag_private.c +++ b/zebra/zebra_mlag_private.c @@ -76,7 +76,7 @@ static int zebra_mlag_read(struct thread *thread) { uint32_t *msglen; uint32_t h_msglen; - uint32_t tot_len, curr_len = mlag_rd_buf_offset; + uint32_t tot_len, curr_len = 0; zrouter.mlag_info.t_read = NULL; @@ -101,7 +101,6 @@ static int zebra_mlag_read(struct thread *thread) zebra_mlag_handle_process_state(MLAG_DOWN); return -1; } - mlag_rd_buf_offset += data_len; if (data_len != (ssize_t)(ZEBRA_MLAG_LEN_SIZE - curr_len)) { /* Try again later */ zebra_mlag_sched_read(); @@ -139,7 +138,6 @@ static int zebra_mlag_read(struct thread *thread) zebra_mlag_handle_process_state(MLAG_DOWN); return -1; } - mlag_rd_buf_offset += data_len; if (data_len != (ssize_t)(tot_len - curr_len)) { /* Try again later */ zebra_mlag_sched_read(); |