git: f7236dd0684e - main - change_mpath_route: Remove write-only nh variable.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Apr 2022 23:46:06 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=f7236dd0684e0a523f2b19b187b5ae3b558de4f2
commit f7236dd0684e0a523f2b19b187b5ae3b558de4f2
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-06 23:45:28 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-06 23:45:28 +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.
---
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 5a4ff943ac2f..3b480c6fd6ea 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++) {