From: Victor Julien Date: Sun, 3 Nov 2019 14:57:23 +0000 (+0100) Subject: threading: remove wrong unlikely statement; minor cleanups X-Git-Tag: suricata-6.0.0-beta1~816 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a1ed3ba1bda47b0103a2386fb890e410fc241a2;p=thirdparty%2Fsuricata.git threading: remove wrong unlikely statement; minor cleanups --- diff --git a/src/tm-threads.c b/src/tm-threads.c index 7177b41622..085617a443 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -112,19 +112,16 @@ void TmThreadsUnsetFlag(ThreadVars *tv, uint32_t flag) * * \todo Deal with post_pq for slots beyond the first. */ -TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, - TmSlot *slot) +TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmSlot *slot) { for (TmSlot *s = slot; s != NULL; s = s->slot_next) { PACKET_PROFILING_TMM_START(p, s->tm_id); - - TmEcode r; - if (unlikely(s->id == 0)) { - r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data), &s->slot_pre_pq, &s->slot_post_pq); - } else { - r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data), &s->slot_pre_pq, NULL); + PacketQueue *post_pq = &s->slot_post_pq; + if (s->id > 0) { + post_pq = NULL; } - + TmEcode r = s->SlotFunc(tv, p, SC_ATOMIC_GET(s->slot_data), + &s->slot_pre_pq, post_pq); PACKET_PROFILING_TMM_END(p, s->tm_id); /* handle error */