Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Sep 2021 18:27:58 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 26cf4b53d9c1 - main - netgraph: pass return value from callout_stop() unmodified to callers of ng_uncallout. Most of them do not check it anyway, so very little node changes are required.
Message-ID:  <202109101827.18AIRw67077198@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=26cf4b53d9c12238479d4b2068d3037cb1940a39

commit 26cf4b53d9c12238479d4b2068d3037cb1940a39
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-08-06 20:12:13 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-09-10 18:26:59 +0000

    netgraph: pass return value from callout_stop() unmodified to callers of
    ng_uncallout. Most of them do not check it anyway, so very little node
    changes are required.
    
    Reviewed by:            mjg, markj
    Differential Revision:  https://reviews.freebsd.org/D31476
---
 sys/netgraph/bluetooth/hci/ng_hci_misc.c     | 4 ++--
 sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c | 6 +++---
 sys/netgraph/ng_base.c                       | 6 +-----
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
index 707af8c84d06..4dc328850fb1 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c
@@ -391,7 +391,7 @@ ng_hci_command_untimeout(ng_hci_unit_p unit)
 		panic(
 "%s: %s - No command timeout!\n", __func__, NG_NODE_NAME(unit->node));
 
-	if (ng_uncallout(&unit->cmd_timo, unit->node) == 0)
+	if (ng_uncallout(&unit->cmd_timo, unit->node) < 1)
 		return (ETIMEDOUT);
 
 	unit->state &= ~NG_HCI_UNIT_COMMAND_PENDING;
@@ -432,7 +432,7 @@ ng_hci_con_untimeout(ng_hci_unit_con_p con)
 		panic(
 "%s: %s - No connection timeout!\n", __func__, NG_NODE_NAME(con->unit->node));
 
-	if (ng_uncallout(&con->con_timo, con->unit->node) == 0)
+	if (ng_uncallout(&con->con_timo, con->unit->node) < 1)
 		return (ETIMEDOUT);
 
 	con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING;
diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
index 7a3daf75ead4..0b925cb14b42 100644
--- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
+++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
@@ -235,7 +235,7 @@ ng_l2cap_discon_untimeout(ng_l2cap_con_p con)
 			__func__,  NG_NODE_NAME(con->l2cap->node),
 			con->state, con->flags);
 
-	if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0)
+	if (ng_uncallout(&con->con_timo, con->l2cap->node) < 1)
 		return (ETIMEDOUT);
 
 	con->flags &= ~NG_L2CAP_CON_AUTO_DISCON_TIMO;
@@ -534,7 +534,7 @@ ng_l2cap_lp_untimeout(ng_l2cap_con_p con)
 			__func__,  NG_NODE_NAME(con->l2cap->node),
 			con->state, con->flags);
 
-	if (ng_uncallout(&con->con_timo, con->l2cap->node) == 0)
+	if (ng_uncallout(&con->con_timo, con->l2cap->node) < 1)
 		return (ETIMEDOUT);
 
 	con->flags &= ~NG_L2CAP_CON_LP_TIMO;
@@ -579,7 +579,7 @@ ng_l2cap_command_untimeout(ng_l2cap_cmd_p cmd)
 			__func__, NG_NODE_NAME(cmd->con->l2cap->node),
 			cmd->code, cmd->flags);
 
-	if (ng_uncallout(&cmd->timo, cmd->con->l2cap->node) == 0)
+	if (ng_uncallout(&cmd->timo, cmd->con->l2cap->node) < 1)
 		return (ETIMEDOUT);
 
 	cmd->flags &= ~NG_L2CAP_CMD_PENDING;
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index ba60acb53502..e0832e794089 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -3840,11 +3840,7 @@ ng_uncallout(struct callout *c, node_p node)
 	}
 	c->c_arg = NULL;
 
-	/*
-	 * Callers only want to know if the callout was cancelled and
-	 * not draining or stopped.
-	 */
-	return (rval > 0);
+	return (rval);
 }
 
 /*



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