Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Apr 2022 23:46:05 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 371c917b0b45 - main - unlink_nhgrp: Remove write-only variable.
Message-ID:  <202204062346.236Nk5uP008768@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=371c917b0b450d1944bf0ea18afdfc158af08f2e

commit 371c917b0b450d1944bf0ea18afdfc158af08f2e
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-06 23:45:27 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-06 23:45:27 +0000

    unlink_nhgrp: Remove write-only variable.
    
    Possibly one could assert that ret should always be 0 here (that is,
    that there was always an index found in the bitmask).  That should be
    true since a bitmask index is allocated before the nhgrp is inserted
    in the ctl->gr_head list in link_nhgrp.
---
 sys/net/route/nhgrp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/net/route/nhgrp.c b/sys/net/route/nhgrp.c
index 07abdf480101..32bcb56460a1 100644
--- a/sys/net/route/nhgrp.c
+++ b/sys/net/route/nhgrp.c
@@ -183,7 +183,7 @@ struct nhgrp_priv *
 unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key)
 {
 	struct nhgrp_priv *nhg_priv_ret;
-	int ret, idx;
+	int idx;
 
 	NHOPS_WLOCK(ctl);
 
@@ -196,7 +196,7 @@ unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key)
 	}
 
 	idx = nhg_priv_ret->nhg_idx;
-	ret = bitmask_free_idx(&ctl->nh_idx_head, idx);
+	bitmask_free_idx(&ctl->nh_idx_head, idx);
 	nhg_priv_ret->nhg_idx = 0;
 	nhg_priv_ret->nh_control = NULL;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204062346.236Nk5uP008768>