git: 1c915de99108 - stable/13 - change_mpath_route: Remove write-only nh variable.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 Jan 2023 21:24:40 UTC
The branch stable/13 has been updated by melifaro:
URL: https://cgit.FreeBSD.org/src/commit/?id=1c915de99108487f58f338ddf1287bda489cb73f
commit 1c915de99108487f58f338ddf1287bda489cb73f
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-06 23:45:28 +0000
Commit: Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-01-13 21:18:25 +0000
change_mpath_route: Remove write-only nh variable.
While here, cleanup the style of the function prologue by moving an
assignment out of the middle of two variable declaration blocks.
(cherry picked from commit f7236dd0684e0a523f2b19b187b5ae3b558de4f2)
---
sys/net/route/route_ctl.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
index 890a25b5f546..afe0a024b832 100644
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -1000,15 +1000,12 @@ change_mpath_route(struct rib_head *rnh, struct rt_addrinfo *info,
struct route_nhop_data *rnd_orig, struct rib_cmd_info *rc)
{
int error = 0;
- struct nhop_object *nh, *nh_orig, *nh_new;
+ struct nhop_object *nh_orig, *nh_new;
struct route_nhop_data rnd_new;
-
- nh = NULL;
- nh_orig = rnd_orig->rnd_nhop;
-
struct weightened_nhop *wn = NULL, *wn_new;
uint32_t num_nhops;
+ nh_orig = rnd_orig->rnd_nhop;
wn = nhgrp_get_nhops((struct nhgrp_object *)nh_orig, &num_nhops);
nh_orig = NULL;
for (int i = 0; i < num_nhops; i++) {