]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threading: remove wrong unlikely statement; minor cleanups
authorVictor Julien <victor@inliniac.net>
Sun, 3 Nov 2019 14:57:23 +0000 (15:57 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 14:43:10 +0000 (15:43 +0100)
src/tm-threads.c

index 7177b41622c206077b1140300cdd7901ca33f54c..085617a4431ce9f8e0e22f937d71c3359064b150 100644 (file)
@@ -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 */