Skip to content

Commit fc451e6

Browse files
dschogitster
authored andcommitted
trace2: avoid "futile conditional"
CodeQL reports empty `if` blocks that only contain a comment as "futile conditional". The comment talks about potential plans to turn this into a warning, but that seems not to have been necessary. Replace the entire construct with a concise comment. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3d39bcd commit fc451e6

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

trace2/tr2_tmr.c

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,11 @@ void tr2_update_final_timers(void)
102102
struct tr2_timer *t_final = &final_timer_block.timer[tid];
103103
struct tr2_timer *t = &ctx->timer_block.timer[tid];
104104

105-
if (t->recursion_count) {
106-
/*
107-
* The current thread is exiting with
108-
* timer[tid] still running.
109-
*
110-
* Technically, this is a bug, but I'm going
111-
* to ignore it.
112-
*
113-
* I don't think it is worth calling die()
114-
* for. I don't think it is worth killing the
115-
* process for this bookkeeping error. We
116-
* might want to call warning(), but I'm going
117-
* to wait on that.
118-
*
119-
* The downside here is that total_ns won't
120-
* include the current open interval (now -
121-
* start_ns). I can live with that.
122-
*/
123-
}
105+
/*
106+
* `t->recursion_count` could technically be non-zero, which
107+
* would constitute a bug. Reporting the bug would potentially
108+
* cause an infinite recursion, though, so let's ignore it.
109+
*/
124110

125111
if (!t->interval_count)
126112
continue; /* this timer was not used by this thread */

0 commit comments

Comments
 (0)