git: 5cb73dbe4820 - main - tcp_hpts: use booleans for tcp_hptsi() local variables
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 Dec 2024 20:25:00 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5cb73dbe48204210d4e2c08a1e15641678612c8a commit 5cb73dbe48204210d4e2c08a1e15641678612c8a Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2024-12-04 20:15:46 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2024-12-04 20:15:46 +0000 tcp_hpts: use booleans for tcp_hptsi() local variables No functional change. --- sys/netinet/tcp_hpts.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 7d897d30392c..d5dea1c98a94 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1086,7 +1086,10 @@ tcp_hptsi(struct tcp_hpts_entry *hpts, bool from_callout) int32_t wrap_loop_cnt = 0; int32_t slot_pos_of_endpoint = 0; int32_t orig_exit_slot; - int8_t completed_measure = 0, seen_endpoint = 0; + bool completed_measure, seen_endpoint; + + completed_measure = false; + seen_endpoint = false; HPTS_MTX_ASSERT(hpts); NET_EPOCH_ASSERT(); @@ -1251,11 +1254,11 @@ again: } /* For debugging */ - if (seen_endpoint == 0) { - seen_endpoint = 1; + if (!seen_endpoint) { + seen_endpoint = true; orig_exit_slot = slot_pos_of_endpoint = runningslot; - } else if (completed_measure == 0) { + } else if (!completed_measure) { /* Record the new position */ orig_exit_slot = runningslot; } @@ -1398,7 +1401,7 @@ again: * is where we calculated the end of our cycle to * be when we first entered. */ - completed_measure = 1; + completed_measure = true; } HPTS_LOCK(hpts); hpts->p_runningslot++; @@ -1436,7 +1439,7 @@ no_one: } hpts->p_curtick = tcp_gethptstick(&tv); hpts->p_cur_slot = tick_to_wheel(hpts->p_curtick); - if (seen_endpoint == 0) { + if (!seen_endpoint) { /* We saw no endpoint but we may be looping */ orig_exit_slot = hpts->p_cur_slot; }