From: Philippe Antoine Date: Wed, 15 May 2024 13:06:39 +0000 (+0200) Subject: style: remove some useless return X-Git-Tag: suricata-8.0.0-beta1~1239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20423fdd38c940dcd745be9c03d25fb40ce23ba0;p=thirdparty%2Fsuricata.git style: remove some useless return and remove empty line before end of function --- diff --git a/src/app-layer-expectation.c b/src/app-layer-expectation.c index 7a456f87a3..6635054268 100644 --- a/src/app-layer-expectation.c +++ b/src/app-layer-expectation.c @@ -386,7 +386,6 @@ void AppLayerExpectationClean(Flow *f) out: if (ipp) IPPairRelease(ipp); - return; } /** diff --git a/src/app-layer-ftp.c b/src/app-layer-ftp.c index 7384e732e5..f76b6dd4cb 100644 --- a/src/app-layer-ftp.c +++ b/src/app-layer-ftp.c @@ -154,14 +154,12 @@ static void FTPParseMemcap(void) static void FTPIncrMemuse(uint64_t size) { - (void) SC_ATOMIC_ADD(ftp_memuse, size); - return; + (void)SC_ATOMIC_ADD(ftp_memuse, size); } static void FTPDecrMemuse(uint64_t size) { - (void) SC_ATOMIC_SUB(ftp_memuse, size); - return; + (void)SC_ATOMIC_SUB(ftp_memuse, size); } uint64_t FTPMemuseGlobalCounter(void) @@ -291,8 +289,6 @@ static void FTPLocalStorageFree(void *ptr) SCFree(td); } - - return; } static FTPTransaction *FTPTransactionCreate(FtpState *state) { diff --git a/src/app-layer-htp-mem.c b/src/app-layer-htp-mem.c index 57967b1d6e..2825b6be7c 100644 --- a/src/app-layer-htp-mem.c +++ b/src/app-layer-htp-mem.c @@ -70,14 +70,12 @@ void HTPParseMemcap(void) static void HTPIncrMemuse(uint64_t size) { - (void) SC_ATOMIC_ADD(htp_memuse, size); - return; + (void)SC_ATOMIC_ADD(htp_memuse, size); } static void HTPDecrMemuse(uint64_t size) { - (void) SC_ATOMIC_SUB(htp_memuse, size); - return; + (void)SC_ATOMIC_SUB(htp_memuse, size); } uint64_t HTPMemuseGlobalCounter(void) diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index c4df1d93dc..b5c0dfd64b 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -2550,10 +2550,8 @@ static void HTPConfigSetDefaultsPhase1(HTPCfgRec *cfg_prec) * config, we have to set the soft limit as well. If libhtp starts using * the soft limit in the future, we at least make sure we control what * it's value is. */ - htp_config_set_field_limits(cfg_prec->cfg, - (size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT, + htp_config_set_field_limits(cfg_prec->cfg, (size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT, (size_t)HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD); - return; } /* hack: htp random range code expects random values in range of 0-RAND_MAX, @@ -2609,7 +2607,6 @@ static void HTPConfigSetDefaultsPhase2(const char *name, HTPCfgRec *cfg_prec) } htp_config_register_request_line(cfg_prec->cfg, HTPCallbackRequestLine); - return; } static void HTPConfigParseParameters(HTPCfgRec *cfg_prec, ConfNode *s, @@ -2990,8 +2987,6 @@ static void HTPConfigParseParameters(HTPCfgRec *cfg_prec, ConfNode *s, p->name); } } /* TAILQ_FOREACH(p, &default_config->head, next) */ - - return; } void HTPConfigure(void) @@ -3318,15 +3313,11 @@ static HTPCfgRec cfglist_backup; void HtpConfigCreateBackup(void) { cfglist_backup = cfglist; - - return; } void HtpConfigRestoreBackup(void) { cfglist = cfglist_backup; - - return; } /** \test Test case where chunks are sent in smaller chunks and check the diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index a1f000f90c..428bae864b 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1781,7 +1781,6 @@ void AppLayerParserRegisterProtocolParsers(void) } ValidateParsers(); - return; } diff --git a/src/app-layer-smb.c b/src/app-layer-smb.c index 0c6102e83e..2cc67f9146 100644 --- a/src/app-layer-smb.c +++ b/src/app-layer-smb.c @@ -50,8 +50,6 @@ void RegisterSMBParsers(void) #ifdef UNITTESTS AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_SMB, SMBParserRegisterTests); #endif - - return; } #ifdef UNITTESTS diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 944187aa4d..3558ff0009 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1591,8 +1591,6 @@ static void SMTPLocalStorageFree(void *ptr) SCFree(td); } - - return; } static void SMTPTransactionFree(SMTPTransaction *tx, SMTPState *state) @@ -1645,8 +1643,6 @@ static void SMTPStateFree(void *p) } SCFree(smtp_state); - - return; } static void SMTPSetMpmState(void) @@ -1667,7 +1663,6 @@ static void SMTPSetMpmState(void) } mpm_table[SMTP_MPM].Prepare(smtp_mpm_ctx); - } static void SMTPFreeMpmState(void) @@ -1783,7 +1778,6 @@ static void *SMTPStateGetTx(void *state, uint64_t id) } } return NULL; - } static int SMTPStateGetAlstateProgress(void *vtx, uint8_t direction) @@ -1904,7 +1898,6 @@ void RegisterSMTPParsers(void) #ifdef UNITTESTS AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_SMTP, SMTPParserRegisterTests); #endif - return; } /** @@ -4258,6 +4251,4 @@ void SMTPParserRegisterTests(void) UtRegisterTest("SMTPParserTest13", SMTPParserTest13); UtRegisterTest("SMTPParserTest14", SMTPParserTest14); #endif /* UNITTESTS */ - - return; } diff --git a/src/app-layer-ssl.c b/src/app-layer-ssl.c index 1cf81b8a52..21797d6788 100644 --- a/src/app-layer-ssl.c +++ b/src/app-layer-ssl.c @@ -2931,8 +2931,6 @@ static void SSLStateFree(void *p) TAILQ_INIT(&ssl_state->client_connp.certs); SCFree(ssl_state); - - return; } static void SSLStateTransactionFree(void *state, uint64_t tx_id) @@ -3327,8 +3325,6 @@ void RegisterSSLParsers(void) } else { SCLogConfig("Parser disabled for %s protocol. Protocol detection still on.", proto_name); } - - return; } /** diff --git a/src/app-layer.c b/src/app-layer.c index b2b720d5f5..a7e50d66d0 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -354,7 +354,6 @@ static void TCPProtoDetectCheckBailConditions(ThreadVars *tv, failure: DisableAppLayer(tv, f, p); - return; } static int TCPProtoDetectTriggerOpposingSide(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index 463eb2e582..f8b9ae2123 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -71,8 +71,6 @@ Mangle(char *string) while ((c = strchr(string, '_'))) *c = '-'; - - return; } /** diff --git a/src/conf.c b/src/conf.c index e232eb6122..3cb9fd0801 100644 --- a/src/conf.c +++ b/src/conf.c @@ -456,7 +456,6 @@ int ConfGetChildValueInt(const ConfNode *base, const char *name, intmax_t *val) *val = tmpint; return 1; - } int ConfGetChildValueIntWithDefault(const ConfNode *base, const ConfNode *dflt, @@ -671,8 +670,6 @@ void ConfCreateContextBackup(void) { root_backup = root; root = NULL; - - return; } /** @@ -683,8 +680,6 @@ void ConfRestoreContextBackup(void) { root = root_backup; root_backup = NULL; - - return; } /** diff --git a/src/counters.c b/src/counters.c index 36172d913d..f6014d096c 100644 --- a/src/counters.c +++ b/src/counters.c @@ -155,7 +155,6 @@ void StatsAddUI64(ThreadVars *tv, uint16_t id, uint64_t x) #endif pca->head[id].value += x; pca->head[id].updates++; - return; } /** @@ -176,7 +175,6 @@ void StatsIncr(ThreadVars *tv, uint16_t id) #endif pca->head[id].value++; pca->head[id].updates++; - return; } /** @@ -197,7 +195,6 @@ void StatsDecr(ThreadVars *tv, uint16_t id) #endif pca->head[id].value--; pca->head[id].updates++; - return; } /** @@ -225,8 +222,6 @@ void StatsSetUI64(ThreadVars *tv, uint16_t id, uint64_t x) } pca->head[id].updates++; - - return; } static ConfNode *GetConfig(void) { @@ -370,8 +365,6 @@ static void StatsReleaseCtx(void) } memset(&stats_table, 0, sizeof(stats_table)); SCMutexUnlock(&stats_table_mutex); - - return; } /** @@ -568,8 +561,6 @@ static void StatsReleaseCounter(StatsCounter *pc) if (pc != NULL) { SCFree(pc); } - - return; } /** @@ -653,7 +644,6 @@ static void StatsCopyCounterValue(StatsLocalCounter *pcae) pc->value = pcae->value; pc->updates = pcae->updates; - return; } /** diff --git a/src/decode-icmpv6.c b/src/decode-icmpv6.c index 4c2a6836fc..b85bed2c4a 100644 --- a/src/decode-icmpv6.c +++ b/src/decode-icmpv6.c @@ -139,8 +139,6 @@ static void DecodePartialIPV6(Packet *p, uint8_t *partial_packet, uint16_t len ) s, d, IPV6_GET_RAW_CLASS(icmp6_ip6h), IPV6_GET_RAW_FLOW(icmp6_ip6h), IPV6_GET_RAW_NH(icmp6_ip6h), IPV6_GET_RAW_PLEN(icmp6_ip6h), IPV6_GET_RAW_HLIM(icmp6_ip6h)); #endif - - return; } /** \retval type counterpart type or -1 */ diff --git a/src/decode-ipv6.c b/src/decode-ipv6.c index dfc2448389..c732d7938d 100644 --- a/src/decode-ipv6.c +++ b/src/decode-ipv6.c @@ -59,7 +59,6 @@ static void DecodeIPv4inIPv6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, c } else { ENGINE_SET_EVENT(p, IPV4_IN_IPV6_WRONG_IP_VER); } - return; } /** diff --git a/src/decode.c b/src/decode.c index f74737ed2c..3eefbcbcb7 100644 --- a/src/decode.c +++ b/src/decode.c @@ -731,8 +731,6 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv) DEvents[i].event_name, tv); } } - - return; } void DecodeUpdatePacketCounters(ThreadVars *tv, diff --git a/src/defrag-config.c b/src/defrag-config.c index 5054ec289b..1574a9367f 100644 --- a/src/defrag-config.c +++ b/src/defrag-config.c @@ -36,8 +36,6 @@ static void DefragPolicyFreeUserData(void *data) { if (data != NULL) SCFree(data); - - return; } static void DefragPolicyAddHostInfo(char *host_ip_range, uint64_t timeout) diff --git a/src/defrag-hash.c b/src/defrag-hash.c index 54e86b9e08..afd1aeeea0 100644 --- a/src/defrag-hash.c +++ b/src/defrag-hash.c @@ -288,8 +288,6 @@ void DefragInitConfig(bool quiet) SCLogConfig("defrag memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(defrag_memuse), SC_ATOMIC_GET(defrag_config.memcap)); } - - return; } /** \brief print some defrag stats @@ -331,7 +329,6 @@ void DefragHashShutdown(void) } (void) SC_ATOMIC_SUB(defrag_memuse, defrag_config.hash_size * sizeof(DefragTrackerHashRow)); DefragTrackerQueueDestroy(&defragtracker_spare_q); - return; } /** \brief compare two raw ipv6 addrs diff --git a/src/detect-app-layer-protocol.c b/src/detect-app-layer-protocol.c index 744321b743..cdef7db532 100644 --- a/src/detect-app-layer-protocol.c +++ b/src/detect-app-layer-protocol.c @@ -228,7 +228,6 @@ error: static void DetectAppLayerProtocolFree(DetectEngineCtx *de_ctx, void *ptr) { SCFree(ptr); - return; } /** \internal @@ -352,8 +351,7 @@ void DetectAppLayerProtocolRegister(void) sigmatch_table[DETECT_AL_APP_LAYER_PROTOCOL].SetupPrefilter = PrefilterSetupAppProto; sigmatch_table[DETECT_AL_APP_LAYER_PROTOCOL].SupportsPrefilter = - PrefilterAppProtoIsPrefilterable; - return; + PrefilterAppProtoIsPrefilterable; } /**********************************Unittests***********************************/ diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index 117cce5975..5b64ed915c 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -644,8 +644,6 @@ static void DetectByteExtractFree(DetectEngineCtx *de_ctx, void *ptr) SCFree((void *)bed->name); SCFree(bed); } - - return; } /** diff --git a/src/detect-csum.c b/src/detect-csum.c index c3f3ffd626..180a0b84b6 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -304,8 +304,6 @@ static void DetectIPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -394,8 +392,6 @@ static void DetectTCPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -485,8 +481,6 @@ static void DetectTCPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -578,8 +572,6 @@ static void DetectUDPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -668,8 +660,6 @@ static void DetectUDPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -758,8 +748,6 @@ static void DetectICMPV4CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /** @@ -853,8 +841,6 @@ static void DetectICMPV6CsumFree(DetectEngineCtx *de_ctx, void *ptr) if (cd != NULL) SCFree(cd); - - return; } /* ---------------------------------- Unit Tests --------------------------- */ diff --git a/src/detect-datarep.c b/src/detect-datarep.c index 5b959b4023..325046786d 100644 --- a/src/detect-datarep.c +++ b/src/detect-datarep.c @@ -238,7 +238,6 @@ static void GetDirName(const char *in, char *out, size_t outs) char *dir = dirname(tmp); BUG_ON(dir == NULL); strlcpy(out, dir, outs); - return; } static int SetupLoadPath(const DetectEngineCtx *de_ctx, diff --git a/src/detect-dataset.c b/src/detect-dataset.c index 70e9e67c94..1fc145267f 100644 --- a/src/detect-dataset.c +++ b/src/detect-dataset.c @@ -252,7 +252,6 @@ static void GetDirName(const char *in, char *out, size_t outs) char *dir = dirname(tmp); BUG_ON(dir == NULL); strlcpy(out, dir, outs); - return; } static int SetupLoadPath(const DetectEngineCtx *de_ctx, diff --git a/src/detect-engine-address-ipv6.c b/src/detect-engine-address-ipv6.c index 3179628c6d..4728662e0a 100644 --- a/src/detect-engine-address-ipv6.c +++ b/src/detect-engine-address-ipv6.c @@ -296,8 +296,6 @@ static void AddressCutIPv6CopySubOne(uint32_t *a, uint32_t *b) b[1] = htonl(b[1]); b[2] = htonl(b[2]); b[3] = htonl(b[3]); - - return; } /** @@ -334,8 +332,6 @@ static void AddressCutIPv6CopyAddOne(uint32_t *a, uint32_t *b) b[1] = htonl(b[1]); b[2] = htonl(b[2]); b[3] = htonl(b[3]); - - return; } /** @@ -352,8 +348,6 @@ static void AddressCutIPv6Copy(uint32_t *a, uint32_t *b) b[1] = htonl(a[1]); b[2] = htonl(a[2]); b[3] = htonl(a[3]); - - return; } int DetectAddressCutIPv6(DetectEngineCtx *de_ctx, DetectAddress *a, @@ -1922,6 +1916,4 @@ void DetectAddressIPv6Tests(void) UtRegisterTest("AddressTestIPv6CutNot04", AddressTestIPv6CutNot04); UtRegisterTest("AddressTestIPv6CutNot05", AddressTestIPv6CutNot05); #endif /* UNITTESTS */ - - return; } diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index 664eaf569b..fb649c1df7 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -85,7 +85,6 @@ void DetectAddressFree(DetectAddress *ag) return; SCFree(ag); - return; } /** @@ -1342,7 +1341,6 @@ void DetectAddressMapFree(DetectEngineCtx *de_ctx) HashListTableFree(de_ctx->address_table); de_ctx->address_table = NULL; - return; } static bool DetectAddressMapAdd(DetectEngineCtx *de_ctx, const char *string, @@ -1487,8 +1485,6 @@ void DetectAddressHeadCleanup(DetectAddressHead *gh) gh->ipv6_head = NULL; } } - - return; } /** @@ -1787,8 +1783,6 @@ static void DetectAddressPrint(DetectAddress *gr) SCLogDebug("%s/%s", ip, mask); // printf("%s/%s", ip, mask); } - - return; } #endif diff --git a/src/detect-engine-alert.c b/src/detect-engine-alert.c index 2ef1e19ca5..e0854c3782 100644 --- a/src/detect-engine-alert.c +++ b/src/detect-engine-alert.c @@ -303,7 +303,6 @@ void AlertQueueAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, Packet SCLogDebug("Appending sid %" PRIu32 ", s->num %" PRIu32 " to alert queue", s->id, s->num); det_ctx->alert_queue_size++; - return; } /** \internal diff --git a/src/detect-engine-analyzer.c b/src/detect-engine-analyzer.c index 5e5d29e92f..0ce0dbc4e8 100644 --- a/src/detect-engine-analyzer.c +++ b/src/detect-engine-analyzer.c @@ -285,7 +285,6 @@ void EngineAnalysisFP(const DetectEngineCtx *de_ctx, const Signature *s, char *l SCFree(pat); fprintf(fp, "\n"); - return; } /** @@ -456,8 +455,6 @@ static void CleanupFPAnalyzer(DetectEngineCtx *de_ctx) fclose(de_ctx->ea->rule_engine_analysis_fp); de_ctx->ea->rule_engine_analysis_fp = NULL; - - return; } static void CleanupRuleAnalyzer(DetectEngineCtx *de_ctx) @@ -617,8 +614,6 @@ static void EngineAnalysisRulesPrintFP(const DetectEngineCtx *de_ctx, const Sign fprintf(ea_ctx->rule_engine_analysis_fp, "(with %d transform(s)) ", bt->transforms.cnt); } fprintf(ea_ctx->rule_engine_analysis_fp, "buffer.\n"); - - return; } void EngineAnalysisRulesFailure(const DetectEngineCtx *de_ctx, char *line, char *file, int lineno) @@ -1830,5 +1825,4 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, } fprintf(fp, "\n"); } - return; } diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index d150ddfba5..f28b0219cc 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -955,7 +955,6 @@ static void RulesDumpGrouping(const DetectEngineCtx *de_ctx, fprintf(fp, "%s\n", js_s); free(js_s); fclose(fp); - return; } static int RulesGroupByProto(DetectEngineCtx *de_ctx) diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index b4d8b86aa1..0cbd1b296f 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -2537,7 +2537,4 @@ void IPOnlyRegisterTests(void) UtRegisterTest("IPOnlyTestBug5168v1", IPOnlyTestBug5168v1); UtRegisterTest("IPOnlyTestBug5168v2", IPOnlyTestBug5168v2); #endif - - return; } - diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index f1b302abce..eca9807df1 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -994,8 +994,6 @@ static void PopulateMpmHelperAddPattern(MpmCtx *mpm_ctx, const DetectContentData cd->id, s->num, flags|MPM_PATTERN_CTX_OWNS_ID); } } - - return; } #define SGH_PROTO(sgh, p) ((sgh)->init->protos[(p)] == 1) @@ -1027,7 +1025,6 @@ static void SetMpm(Signature *s, SigMatch *mpm_sm, const int mpm_sm_list) cd->flags |= DETECT_CONTENT_MPM; s->init_data->mpm_sm_list = mpm_sm_list; s->init_data->mpm_sm = mpm_sm; - return; } static SigMatch *GetMpmForList(const Signature *s, SigMatch *list, SigMatch *mpm_sm, @@ -1269,7 +1266,6 @@ void RetrieveFPForSig(const DetectEngineCtx *de_ctx, Signature *s) #endif /* assign to signature */ SetMpm(s, mpm_sm, mpm_sm_list); - return; } /** \internal @@ -1529,7 +1525,6 @@ void MpmStoreFree(DetectEngineCtx *de_ctx) HashListTableFree(de_ctx->mpm_hash_table); de_ctx->mpm_hash_table = NULL; - return; } static void MpmStoreSetup(const DetectEngineCtx *de_ctx, MpmStore *ms) diff --git a/src/detect-engine-payload.c b/src/detect-engine-payload.c index 7fc4c0e161..4154a093dc 100644 --- a/src/detect-engine-payload.c +++ b/src/detect-engine-payload.c @@ -1179,6 +1179,4 @@ void PayloadRegisterTests(void) UtRegisterTest("PayloadTestSig33", PayloadTestSig33); UtRegisterTest("PayloadTestSig34", PayloadTestSig34); #endif /* UNITTESTS */ - - return; } diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index 263e7c30a9..4b0031d200 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -1425,8 +1425,6 @@ void DetectPortHashFree(DetectEngineCtx *de_ctx) HashListTableFree(de_ctx->dport_hash_table); de_ctx->dport_hash_table = NULL; - - return; } /*---------------------- Unittests -------------------------*/ @@ -2374,4 +2372,3 @@ void DetectPortTests(void) } #endif /* UNITTESTS */ - diff --git a/src/detect-engine-siggroup.c b/src/detect-engine-siggroup.c index e483c918b4..49982f028b 100644 --- a/src/detect-engine-siggroup.c +++ b/src/detect-engine-siggroup.c @@ -185,8 +185,6 @@ void SigGroupHeadFree(const DetectEngineCtx *de_ctx, SigGroupHead *sgh) PrefilterCleanupRuleGroup(de_ctx, sgh); SCFree(sgh); - - return; } /** @@ -316,8 +314,6 @@ void SigGroupHeadHashFree(DetectEngineCtx *de_ctx) HashListTableFree(de_ctx->sgh_hash_table); de_ctx->sgh_hash_table = NULL; - - return; } /** @@ -471,7 +467,6 @@ void SigGroupHeadSetSigCnt(SigGroupHead *sgh, uint32_t max_idx) } sgh->init->sig_cnt = cnt; #endif - return; } /** @@ -622,8 +617,6 @@ void SigGroupHeadSetupFiles(const DetectEngineCtx *de_ctx, SigGroupHead *sgh) sgh->filestore_cnt++; } } - - return; } /** \brief build an array of rule id's for sigs with no prefilter diff --git a/src/detect-engine-sigorder.c b/src/detect-engine-sigorder.c index ea51e191ec..28bfd71569 100644 --- a/src/detect-engine-sigorder.c +++ b/src/detect-engine-sigorder.c @@ -109,8 +109,6 @@ static void SCSigRegisterSignatureOrderingFunc(DetectEngineCtx *de_ctx, de_ctx->sc_sig_order_funcs = temp; else prev->next = temp; - - return; } /** diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index aead3547e8..3a9067ce89 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -181,15 +181,11 @@ void DetectEngineStateFree(DetectEngineState *state) } } SCFree(state); - - return; } static void StoreFileNoMatchCnt(DetectEngineState *de_state, uint16_t file_no_match, uint8_t direction) { de_state->dir_state[(direction & STREAM_TOSERVER) ? 0 : 1].filestore_cnt += file_no_match; - - return; } static bool StoreFilestoreSigsCantMatch(const SigGroupHead *sgh, const DetectEngineState *de_state, uint8_t direction) @@ -1458,8 +1454,6 @@ void DeStateRegisterTests(void) UtRegisterTest("DeStateSigTest09", DeStateSigTest09); UtRegisterTest("DeStateSigTest10", DeStateSigTest10); #endif - - return; } /** diff --git a/src/detect-engine.c b/src/detect-engine.c index 4f66560fa8..995d285f74 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -991,7 +991,6 @@ static void DetectBufferTypeFree(void) HashListTableFree(g_buffer_type_hash); g_buffer_type_hash = NULL; - return; } #endif static int DetectBufferTypeAdd(const char *string) @@ -2533,7 +2532,6 @@ error: DetectEngineCtxFree(de_ctx); } return NULL; - } DetectEngineCtx *DetectEngineCtxInitStubForMT(void) @@ -4938,8 +4936,6 @@ static void DetectEngineDeInitYamlConf(void) { ConfDeInit(); ConfRestoreContextBackup(); - - return; } static int DetectEngineTest01(void) @@ -5137,5 +5133,4 @@ void DetectEngineRegisterTests(void) UtRegisterTest("DetectEngineTest08", DetectEngineTest08); UtRegisterTest("DetectEngineTest09", DetectEngineTest09); #endif - return; } diff --git a/src/detect-fast-pattern.c b/src/detect-fast-pattern.c index 52a7466551..1af1daeea3 100644 --- a/src/detect-fast-pattern.c +++ b/src/detect-fast-pattern.c @@ -117,7 +117,6 @@ static void Add(SCFPSupportSMList **list, const int list_id, const int priority) new->next = ip->next; ip->next = new; } - return; } /** diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index b7a737e6c7..bf2a1fc8ac 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -126,8 +126,7 @@ void DetectFilemagicRegister(void) DetectBufferTypeSupportsMultiInstance("file.magic"); g_file_magic_buffer_id = DetectBufferTypeGetByName("file.magic"); - SCLogDebug("registering filemagic rule option"); - return; + SCLogDebug("registering filemagic rule option"); } #define FILEMAGIC_MIN_SIZE 512 diff --git a/src/detect-filemd5.c b/src/detect-filemd5.c index 9ea08803d8..12517df103 100644 --- a/src/detect-filemd5.c +++ b/src/detect-filemd5.c @@ -55,7 +55,6 @@ void DetectFileMd5Register(void) g_file_match_list_id = DetectBufferTypeRegister("files"); SCLogDebug("registering filemd5 rule option"); - return; } /** diff --git a/src/detect-filename.c b/src/detect-filename.c index 10646f019f..d8fcd351fc 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -118,7 +118,6 @@ void DetectFilenameRegister(void) filehandler_table[DETECT_FILE_NAME].Callback = DetectEngineInspectFilename; DetectBufferTypeSupportsMultiInstance("file.name"); - return; } static int DetectFileextSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) diff --git a/src/detect-filesha1.c b/src/detect-filesha1.c index 6eef33c608..069cd4b18b 100644 --- a/src/detect-filesha1.c +++ b/src/detect-filesha1.c @@ -55,7 +55,6 @@ void DetectFileSha1Register(void) g_file_match_list_id = DetectBufferTypeRegister("files"); SCLogDebug("registering filesha1 rule option"); - return; } /** diff --git a/src/detect-filesha256.c b/src/detect-filesha256.c index 3b41f42f95..b9d2d36aa5 100644 --- a/src/detect-filesha256.c +++ b/src/detect-filesha256.c @@ -56,7 +56,6 @@ void DetectFileSha256Register(void) g_file_match_list_id = DetectBufferTypeRegister("files"); SCLogDebug("registering filesha256 rule option"); - return; } /** diff --git a/src/detect-http2.c b/src/detect-http2.c index 1e047e57cd..113fb1af3f 100644 --- a/src/detect-http2.c +++ b/src/detect-http2.c @@ -217,7 +217,6 @@ void DetectHttp2Register(void) "http2", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT, 0, DetectEngineInspectGenericList, NULL); g_http2_match_buffer_id = DetectBufferTypeRegister("http2"); - return; } /** diff --git a/src/detect-icmpv4hdr.c b/src/detect-icmpv4hdr.c index 0d4e90675c..259fbdc2ec 100644 --- a/src/detect-icmpv4hdr.c +++ b/src/detect-icmpv4hdr.c @@ -62,8 +62,6 @@ void DetectIcmpv4HdrRegister(void) DetectPktMpmRegister("icmpv4.hdr", 2, PrefilterGenericMpmPktRegister, GetData); DetectPktInspectEngineRegister("icmpv4.hdr", GetData, DetectEngineInspectPktBufferGeneric); - - return; } /** diff --git a/src/detect-icmpv6-mtu.c b/src/detect-icmpv6-mtu.c index d4f67ad4a7..8f5e21f156 100644 --- a/src/detect-icmpv6-mtu.c +++ b/src/detect-icmpv6-mtu.c @@ -58,7 +58,6 @@ void DetectICMPv6mtuRegister(void) #endif sigmatch_table[DETECT_ICMPV6MTU].SupportsPrefilter = PrefilterIcmpv6mtuIsPrefilterable; sigmatch_table[DETECT_ICMPV6MTU].SetupPrefilter = PrefilterSetupIcmpv6mtu; - return; } // returns 0 on no mtu, and 1 if mtu diff --git a/src/detect-icmpv6hdr.c b/src/detect-icmpv6hdr.c index 4eec2b939d..54f1cd35a0 100644 --- a/src/detect-icmpv6hdr.c +++ b/src/detect-icmpv6hdr.c @@ -66,10 +66,7 @@ void DetectICMPv6hdrRegister(void) DetectPktMpmRegister("icmpv6.hdr", 2, PrefilterGenericMpmPktRegister, GetData); - DetectPktInspectEngineRegister("icmpv6.hdr", GetData, - DetectEngineInspectPktBufferGeneric); - - return; + DetectPktInspectEngineRegister("icmpv6.hdr", GetData, DetectEngineInspectPktBufferGeneric); } /** diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index 31228fb1b6..8151a71f71 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -441,8 +441,6 @@ void DetectIPProtoRemoveAllSMs(DetectEngineCtx *de_ctx, Signature *s) SigMatchFree(de_ctx, sm); sm = tmp_sm; } - - return; } static void DetectIPProtoFree(DetectEngineCtx *de_ctx, void *ptr) @@ -928,7 +926,6 @@ static int DetectIPProtoTestSetup15(void) end: SigFree(NULL, sig); return result; - } static int DetectIPProtoTestSetup16(void) @@ -966,7 +963,6 @@ static int DetectIPProtoTestSetup16(void) end: SigFree(NULL, sig); return result; - } static int DetectIPProtoTestSetup17(void) @@ -1004,7 +1000,6 @@ static int DetectIPProtoTestSetup17(void) end: SigFree(NULL, sig); return result; - } static int DetectIPProtoTestSetup18(void) @@ -1042,7 +1037,6 @@ static int DetectIPProtoTestSetup18(void) end: SigFree(NULL, sig); return result; - } static int DetectIPProtoTestSetup19(void) diff --git a/src/detect-ipv4hdr.c b/src/detect-ipv4hdr.c index 52dfa71f50..78fe0062ea 100644 --- a/src/detect-ipv4hdr.c +++ b/src/detect-ipv4hdr.c @@ -65,10 +65,7 @@ void DetectIpv4hdrRegister(void) DetectPktMpmRegister("ipv4.hdr", 2, PrefilterGenericMpmPktRegister, GetData); - DetectPktInspectEngineRegister("ipv4.hdr", GetData, - DetectEngineInspectPktBufferGeneric); - - return; + DetectPktInspectEngineRegister("ipv4.hdr", GetData, DetectEngineInspectPktBufferGeneric); } /** diff --git a/src/detect-ipv6hdr.c b/src/detect-ipv6hdr.c index 1616fb1eb8..2f5e79d33d 100644 --- a/src/detect-ipv6hdr.c +++ b/src/detect-ipv6hdr.c @@ -65,10 +65,7 @@ void DetectIpv6hdrRegister(void) DetectPktMpmRegister("ipv6.hdr", 2, PrefilterGenericMpmPktRegister, GetData); - DetectPktInspectEngineRegister("ipv6.hdr", GetData, - DetectEngineInspectPktBufferGeneric); - - return; + DetectPktInspectEngineRegister("ipv6.hdr", GetData, DetectEngineInspectPktBufferGeneric); } /** diff --git a/src/detect-lua.c b/src/detect-lua.c index ffc5362054..36f045f503 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -95,7 +95,6 @@ void DetectLuaRegister(void) DetectEngineInspectGenericList, NULL); SCLogDebug("registering lua rule option"); - return; } /* Flags for DetectLuaThreadData. */ diff --git a/src/detect-parse.c b/src/detect-parse.c index 4d159a8832..74082cf521 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -538,8 +538,6 @@ void SigMatchRemoveSMFromList(Signature *s, SigMatch *sm, int sm_list) sm->prev->next = sm->next; if (sm->next != NULL) sm->next->prev = sm->prev; - - return; } /** @@ -802,8 +800,6 @@ static void SigMatchTransferSigMatchAcrossLists(SigMatch *sm, sm->next = NULL; *dst_sm_list_tail = sm; } - - return; } int SigMatchListSMBelongsTo(const Signature *s, const SigMatch *key_sm) @@ -2350,8 +2346,6 @@ static void DetectParseDupSigFreeFunc(void *data) { if (data != NULL) SCFree(data); - - return; } /** @@ -2430,8 +2424,6 @@ void DetectParseDupSigHashFree(DetectEngineCtx *de_ctx) HashListTableFree(de_ctx->dup_sig_hash_table); de_ctx->dup_sig_hash_table = NULL; - - return; } /** diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 6d20dd08bb..fdbd8fd87a 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -154,8 +154,6 @@ void DetectPcreRegister (void) pcre2_use_jit = 0; } #endif - - return; } /** @@ -972,8 +970,6 @@ static void DetectPcreFree(DetectEngineCtx *de_ctx, void *ptr) VarNameStoreUnregister(pd->capids[i], pd->captypes[i]); } SCFree(pd); - - return; } #ifdef UNITTESTS /* UNITTESTS */ @@ -2066,6 +2062,5 @@ static void DetectPcreRegisterTests(void) UtRegisterTest("DetectPcreParseHttpHost", DetectPcreParseHttpHost); UtRegisterTest("DetectPcreParseCaptureTest", DetectPcreParseCaptureTest); - } #endif /* UNITTESTS */ diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index 888aeaef4d..1ad10cc387 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -332,8 +332,6 @@ static void DetectSslStateFree(DetectEngineCtx *de_ctx, void *ptr) { if (ptr != NULL) SCFree(ptr); - - return; } #ifdef UNITTESTS diff --git a/src/detect-tcphdr.c b/src/detect-tcphdr.c index d5a29d093a..fd7df2f687 100644 --- a/src/detect-tcphdr.c +++ b/src/detect-tcphdr.c @@ -65,10 +65,7 @@ void DetectTcphdrRegister(void) DetectPktMpmRegister("tcp.hdr", 2, PrefilterGenericMpmPktRegister, GetData); - DetectPktInspectEngineRegister("tcp.hdr", GetData, - DetectEngineInspectPktBufferGeneric); - - return; + DetectPktInspectEngineRegister("tcp.hdr", GetData, DetectEngineInspectPktBufferGeneric); } /** diff --git a/src/detect-tcpmss.c b/src/detect-tcpmss.c index b1a1ffd72a..5c7acdb2ff 100644 --- a/src/detect-tcpmss.c +++ b/src/detect-tcpmss.c @@ -58,8 +58,6 @@ void DetectTcpmssRegister(void) sigmatch_table[DETECT_TCPMSS].Free = DetectTcpmssFree; sigmatch_table[DETECT_TCPMSS].SupportsPrefilter = PrefilterTcpmssIsPrefilterable; sigmatch_table[DETECT_TCPMSS].SetupPrefilter = PrefilterSetupTcpmss; - - return; } /** diff --git a/src/detect-template2.c b/src/detect-template2.c index 249831aaf7..c38e9fe33f 100644 --- a/src/detect-template2.c +++ b/src/detect-template2.c @@ -58,8 +58,6 @@ void DetectTemplate2Register(void) sigmatch_table[DETECT_TEMPLATE2].Free = DetectTemplate2Free; sigmatch_table[DETECT_TEMPLATE2].SupportsPrefilter = PrefilterTemplate2IsPrefilterable; sigmatch_table[DETECT_TEMPLATE2].SetupPrefilter = PrefilterSetupTemplate2; - - return; } /** diff --git a/src/detect-tos.c b/src/detect-tos.c index aa5cc2090f..d4d2d2fe65 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -364,6 +364,5 @@ void DetectTosRegisterTests(void) UtRegisterTest("DetectTosTest09", DetectTosTest09); UtRegisterTest("DetectTosTest10", DetectTosTest10); UtRegisterTest("DetectTosTest12", DetectTosTest12); - return; } #endif diff --git a/src/detect-ttl.c b/src/detect-ttl.c index e16dbf8581..edc5b1b225 100644 --- a/src/detect-ttl.c +++ b/src/detect-ttl.c @@ -64,8 +64,6 @@ void DetectTtlRegister(void) #endif sigmatch_table[DETECT_TTL].SupportsPrefilter = PrefilterTtlIsPrefilterable; sigmatch_table[DETECT_TTL].SetupPrefilter = PrefilterSetupTtl; - - return; } /** diff --git a/src/detect-udphdr.c b/src/detect-udphdr.c index cfc91bc7a1..9f6d16ebf0 100644 --- a/src/detect-udphdr.c +++ b/src/detect-udphdr.c @@ -64,9 +64,7 @@ void DetectUdphdrRegister(void) DetectPktMpmRegister("udp.hdr", 2, PrefilterGenericMpmPktRegister, GetData); - DetectPktInspectEngineRegister("udp.hdr", GetData, - DetectEngineInspectPktBufferGeneric); - return; + DetectPktInspectEngineRegister("udp.hdr", GetData, DetectEngineInspectPktBufferGeneric); } /** diff --git a/src/detect.c b/src/detect.c index 6111d2ebfd..989f1133da 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1806,7 +1806,6 @@ static void DetectNoFlow(ThreadVars *tv, /* see if the packet matches one or more of the sigs */ DetectRun(tv, de_ctx, det_ctx, p); - return; } /** \brief Detection engine thread wrapper. @@ -1914,4 +1913,3 @@ void SigMatchSignatures( #ifdef UNITTESTS #include "tests/detect.c" #endif - diff --git a/src/flow-manager.c b/src/flow-manager.c index b1d073029c..cd124a3c45 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -166,7 +166,6 @@ again: /* reset count, so we can kill and respawn (unix socket) */ SC_ATOMIC_SET(flowmgr_cnt, 0); - return; } /** \internal @@ -949,7 +948,6 @@ void FlowManagerThreadSpawn(void) FatalError("flow manager thread spawn failed"); } } - return; } typedef struct FlowRecyclerThreadData_ { @@ -1150,7 +1148,6 @@ void FlowRecyclerThreadSpawn(void) FatalError("flow recycler thread spawn failed"); } } - return; } /** @@ -1217,7 +1214,6 @@ again: /* reset count, so we can kill and respawn (unix socket) */ SC_ATOMIC_SET(flowrec_cnt, 0); - return; } void TmModuleFlowManagerRegister (void) diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 1bfa18a1cb..5c75e242cb 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -409,7 +409,6 @@ static inline void FlowForceReassemblyForHash(void) } FBLOCK_UNLOCK(fb); } - return; } /** @@ -419,5 +418,4 @@ void FlowForceReassembly(void) { /* Carry out flow reassembly for unattended flows */ FlowForceReassemblyForHash(); - return; } diff --git a/src/flow.c b/src/flow.c index 7f372efb94..b43eae2088 100644 --- a/src/flow.c +++ b/src/flow.c @@ -141,7 +141,6 @@ void FlowCleanupAppLayer(Flow *f) AppLayerParserStateCleanup(f, f->alstate, f->alparser); f->alstate = NULL; f->alparser = NULL; - return; } /** \brief Set the IPOnly scanned flag for 'direction'. @@ -151,9 +150,7 @@ void FlowCleanupAppLayer(Flow *f) */ void FlowSetIPOnlyFlag(Flow *f, int direction) { - direction ? (f->flags |= FLOW_TOSERVER_IPONLY_SET) : - (f->flags |= FLOW_TOCLIENT_IPONLY_SET); - return; + direction ? (f->flags |= FLOW_TOSERVER_IPONLY_SET) : (f->flags |= FLOW_TOCLIENT_IPONLY_SET); } /** \brief Set flag to indicate that flow has alerts @@ -651,7 +648,6 @@ void FlowInitConfig(bool quiet) SCLogConfig("flow size %u, memcap allows for %" PRIu64 " flows. Per hash row in perfect " "conditions %" PRIu64, sz, flow_memcap_copy / sz, (flow_memcap_copy / sz) / flow_config.hash_size); - return; } void FlowReset(void) @@ -709,7 +705,6 @@ void FlowShutdown(void) FlowQueueDestroy(&flow_recycle_q); FlowSparePoolDestroy(); DEBUG_VALIDATE_BUG_ON(SC_ATOMIC_GET(flow_memuse) != 0); - return; } /** @@ -1079,8 +1074,6 @@ void FlowInitFlowProto(void) SCLogDebug("deltas: new: -%u est: -%u closed: -%u bypassed: -%u", d->new_timeout, d->est_timeout, d->closed_timeout, d->bypassed_timeout); } - - return; } /** diff --git a/src/host.c b/src/host.c index 2e53789cbf..a351b6daec 100644 --- a/src/host.c +++ b/src/host.c @@ -277,8 +277,6 @@ void HostInitConfig(bool quiet) SCLogConfig("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(host_memuse), SC_ATOMIC_GET(host_config.memcap)); } - - return; } /** \brief print some host stats @@ -289,9 +287,8 @@ void HostPrintStats (void) SCLogPerf("hostbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "", hostbits_added, hostbits_removed, hostbits_memuse_max); #endif /* HOSTBITS_STATS */ - SCLogPerf("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64, - SC_ATOMIC_GET(host_memuse), SC_ATOMIC_GET(host_config.memcap)); - return; + SCLogPerf("host memory usage: %" PRIu64 " bytes, maximum: %" PRIu64, SC_ATOMIC_GET(host_memuse), + SC_ATOMIC_GET(host_config.memcap)); } /** \brief shutdown the flow engine @@ -325,7 +322,6 @@ void HostShutdown(void) } (void) SC_ATOMIC_SUB(host_memuse, host_config.hash_size * sizeof(HostHashRow)); HostQueueDestroy(&host_spare_q); - return; } /** \brief Cleanup the host engine @@ -366,8 +362,6 @@ void HostCleanup(void) HRLOCK_UNLOCK(hb); } } - - return; } /* calculate the hash key for this packet @@ -724,4 +718,3 @@ void HostRegisterUnittests(void) { RegisterHostStorageTests(); } - diff --git a/src/ippair.c b/src/ippair.c index ae77d7ca38..82dc3b30c1 100644 --- a/src/ippair.c +++ b/src/ippair.c @@ -274,8 +274,6 @@ void IPPairInitConfig(bool quiet) SCLogConfig("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(ippair_memuse), SC_ATOMIC_GET(ippair_config.memcap)); } - - return; } /** \brief print some ippair stats @@ -286,9 +284,8 @@ void IPPairPrintStats (void) SCLogPerf("ippairbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "", ippairbits_added, ippairbits_removed, ippairbits_memuse_max); #endif /* IPPAIRBITS_STATS */ - SCLogPerf("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64, + SCLogPerf("ippair memory usage: %" PRIu64 " bytes, maximum: %" PRIu64, SC_ATOMIC_GET(ippair_memuse), SC_ATOMIC_GET(ippair_config.memcap)); - return; } /** \brief shutdown the flow engine @@ -323,7 +320,6 @@ void IPPairShutdown(void) } (void) SC_ATOMIC_SUB(ippair_memuse, ippair_config.hash_size * sizeof(IPPairHashRow)); IPPairQueueDestroy(&ippair_spare_q); - return; } /** \brief Cleanup the ippair engine @@ -364,8 +360,6 @@ void IPPairCleanup(void) HRLOCK_UNLOCK(hb); } } - - return; } /** \brief compare two raw ipv6 addrs diff --git a/src/log-pcap.c b/src/log-pcap.c index ad6a8d77c4..c0b6ef7d00 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -215,7 +215,6 @@ void PcapLogRegister(void) PcapLogProfileSetup(); SC_ATOMIC_INIT(thread_cnt); SC_ATOMIC_SET(thread_cnt, 1); /* first id is 1 */ - return; } #define PCAPLOG_PROFILE_START \ @@ -322,8 +321,6 @@ static void PcapFileNameFree(PcapFileName *pf) } SCFree(pf); } - - return; } /** @@ -1635,8 +1632,6 @@ static void PcapLogFileDeInitCtx(OutputCtx *output_ctx) pcre2_code_free(pcre_timestamp_code); pcre2_match_data_free(pcre_timestamp_match); - - return; } /** diff --git a/src/output-json-email-common.c b/src/output-json-email-common.c index 19afe78b7c..ab8718aeb4 100644 --- a/src/output-json-email-common.c +++ b/src/output-json-email-common.c @@ -413,5 +413,4 @@ void OutputEmailInitConf(ConfNode *conf, OutputJsonEmailCtx *email_ctx) } } } - return; } diff --git a/src/reputation.c b/src/reputation.c index 8533bb0227..055aca1390 100644 --- a/src/reputation.c +++ b/src/reputation.c @@ -73,8 +73,6 @@ static void SRepCIDRFreeUserData(void *data) { if (data != NULL) SCFree(data); - - return; } static void SRepCIDRAddNetblock(SRepCIDRTree *cidr_ctx, char *ip, int cat, uint8_t value) @@ -264,7 +262,6 @@ static int SRepCatSplitLine(char *line, uint8_t *cat, char *shortname, size_t sh *cat = (uint8_t)c; strlcpy(shortname, ptrs[1], shortname_len); return 0; - } /** @@ -432,7 +429,6 @@ static int SRepLoadFile(SRepCIDRTree *cidr_ctx, char *filename) fclose(fp); fp = NULL; return r; - } int SRepLoadFileFromFD(SRepCIDRTree *cidr_ctx, FILE *fp) diff --git a/src/runmode-af-packet.c b/src/runmode-af-packet.c index 2521327ddf..c7f61fb00c 100644 --- a/src/runmode-af-packet.c +++ b/src/runmode-af-packet.c @@ -146,7 +146,6 @@ void RunModeIdsAFPRegister(void) "each flow are assigned to a single detect " "thread.", RunModeIdsAFPAutoFp, AFPRunModeEnableIPS); - return; } diff --git a/src/runmode-af-xdp.c b/src/runmode-af-xdp.c index 75f098eadb..7c27ee6ba8 100644 --- a/src/runmode-af-xdp.c +++ b/src/runmode-af-xdp.c @@ -76,8 +76,6 @@ void RunModeIdsAFXDPRegister(void) "Workers af-xdp mode, each thread does all" " tasks from acquisition to logging", RunModeIdsAFXDPWorkers, NULL); - - return; } #ifdef HAVE_AF_XDP diff --git a/src/runmode-erf-dag.c b/src/runmode-erf-dag.c index 503d1a1556..de16011f1a 100644 --- a/src/runmode-erf-dag.c +++ b/src/runmode-erf-dag.c @@ -62,8 +62,6 @@ void RunModeErfDagRegister(void) "Workers DAG mode, each thread does all " " tasks from acquisition to logging", RunModeIdsErfDagWorkers, NULL); - - return; } int RunModeIdsErfDagSingle(void) diff --git a/src/runmode-erf-file.c b/src/runmode-erf-file.c index dc09509d04..ee56341bad 100644 --- a/src/runmode-erf-file.c +++ b/src/runmode-erf-file.c @@ -45,8 +45,6 @@ void RunModeErfFileRegister(void) "Multi threaded ERF file mode. Packets from " "each flow are assigned to a single detect thread", RunModeErfFileAutoFp, NULL); - - return; } int RunModeErfFileSingle(void) diff --git a/src/runmode-ipfw.c b/src/runmode-ipfw.c index de72f0623d..4538abc659 100644 --- a/src/runmode-ipfw.c +++ b/src/runmode-ipfw.c @@ -53,8 +53,6 @@ void RunModeIpsIPFWRegister(void) RunModeRegisterNewRunMode(RUNMODE_IPFW, "workers", "Multi queue IPFW IPS mode with one thread per queue", RunModeIpsIPFWWorker, NULL); - - return; } int RunModeIpsIPFWAutoFp(void) diff --git a/src/runmode-netmap.c b/src/runmode-netmap.c index bb91475d67..0728cf6625 100644 --- a/src/runmode-netmap.c +++ b/src/runmode-netmap.c @@ -137,7 +137,6 @@ void RunModeIdsNetmapRegister(void) "each flow are assigned to a single detect " "thread.", RunModeIdsNetmapAutoFp, NetmapRunModeEnableIPS); - return; } #ifdef HAVE_NETMAP diff --git a/src/runmode-nflog.c b/src/runmode-nflog.c index 28b9ae5efd..cc92a0e803 100644 --- a/src/runmode-nflog.c +++ b/src/runmode-nflog.c @@ -218,5 +218,4 @@ void RunModeIdsNflogRegister(void) RUNMODE_NFLOG, "single", "Single threaded nflog mode", RunModeIdsNflogSingle, NULL); RunModeRegisterNewRunMode( RUNMODE_NFLOG, "workers", "Workers nflog mode", RunModeIdsNflogWorkers, NULL); - return; } diff --git a/src/runmode-nfq.c b/src/runmode-nfq.c index d9ea93c746..70c6a1c40a 100644 --- a/src/runmode-nfq.c +++ b/src/runmode-nfq.c @@ -51,7 +51,6 @@ void RunModeIpsNFQRegister(void) RunModeRegisterNewRunMode(RUNMODE_NFQ, "workers", "Multi queue NFQ IPS mode with one thread per queue", RunModeIpsNFQWorker, NULL); - return; } int RunModeIpsNFQAutoFp(void) diff --git a/src/runmode-pcap-file.c b/src/runmode-pcap-file.c index 7c5bfcc4c3..e820eca10c 100644 --- a/src/runmode-pcap-file.c +++ b/src/runmode-pcap-file.c @@ -45,8 +45,6 @@ void RunModeFilePcapRegister(void) "Multi-threaded pcap file mode. Packets from each flow are assigned to a consistent " "detection thread", RunModeFilePcapAutoFp, NULL); - - return; } /** diff --git a/src/runmode-pcap.c b/src/runmode-pcap.c index 21c32846b7..ec881ced4a 100644 --- a/src/runmode-pcap.c +++ b/src/runmode-pcap.c @@ -48,8 +48,6 @@ void RunModeIdsPcapRegister(void) "Workers pcap live mode, each thread does all" " tasks from acquisition to logging", RunModeIdsPcapWorkers, NULL); - - return; } static void PcapDerefConfig(void *conf) diff --git a/src/runmode-pfring.c b/src/runmode-pfring.c index 584a409e85..7b0fe7b3d2 100644 --- a/src/runmode-pfring.c +++ b/src/runmode-pfring.c @@ -63,7 +63,6 @@ void RunModeIdsPfringRegister(void) "Workers pfring mode, each thread does all" " tasks from acquisition to logging", RunModeIdsPfringWorkers, NULL); - return; } #ifdef HAVE_PFRING diff --git a/src/runmodes.c b/src/runmodes.c index a8bfea0309..287567570c 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -247,7 +247,6 @@ void RunModeRegisterRunModes(void) #ifdef UNITTESTS UtRunModeRegister(); #endif - return; } /** @@ -290,8 +289,6 @@ void RunModeListRunmodes(void) "-----------------------\n"); } } - - return; } static const char *RunModeGetConfOrDefault(int capture_mode, const char *capture_plugin_name) @@ -520,8 +517,6 @@ void RunModeRegisterNewRunMode(enum RunModes runmode, const char *name, const ch } mode->RunModeFunc = RunModeFunc; mode->RunModeIsIPSEnabled = RunModeIsIPSEnabled; - - return; } /** diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 317e021a8e..97c2408912 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -114,8 +114,8 @@ void StreamTcpReassembleInitMemuse(void) void StreamTcpReassembleIncrMemuse(uint64_t size) { (void) SC_ATOMIC_ADD(ra_memuse, size); - SCLogDebug("REASSEMBLY %"PRIu64", incr %"PRIu64, StreamTcpReassembleMemuseGlobalCounter(), size); - return; + SCLogDebug("REASSEMBLY %" PRIu64 ", incr %" PRIu64, StreamTcpReassembleMemuseGlobalCounter(), + size); } /** @@ -141,8 +141,8 @@ void StreamTcpReassembleDecrMemuse(uint64_t size) BUG_ON(postsize > presize); } #endif - SCLogDebug("REASSEMBLY %"PRIu64", decr %"PRIu64, StreamTcpReassembleMemuseGlobalCounter(), size); - return; + SCLogDebug("REASSEMBLY %" PRIu64 ", decr %" PRIu64, StreamTcpReassembleMemuseGlobalCounter(), + size); } uint64_t StreamTcpReassembleMemuseGlobalCounter(void) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index f89b565381..337b626810 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -228,8 +228,7 @@ void StreamTcpInitMemuse(void) void StreamTcpIncrMemuse(uint64_t size) { (void) SC_ATOMIC_ADD(st_memuse, size); - SCLogDebug("STREAM %"PRIu64", incr %"PRIu64, StreamTcpMemuseCounter(), size); - return; + SCLogDebug("STREAM %" PRIu64 ", incr %" PRIu64, StreamTcpMemuseCounter(), size); } void StreamTcpDecrMemuse(uint64_t size) @@ -249,8 +248,7 @@ void StreamTcpDecrMemuse(uint64_t size) BUG_ON(postsize > presize); } #endif - SCLogDebug("STREAM %"PRIu64", decr %"PRIu64, StreamTcpMemuseCounter(), size); - return; + SCLogDebug("STREAM %" PRIu64 ", decr %" PRIu64, StreamTcpMemuseCounter(), size); } uint64_t StreamTcpMemuseCounter(void) @@ -967,8 +965,7 @@ void StreamTcpSetOSPolicy(TcpStream *stream, Packet *p) else if (stream->os_policy == OS_POLICY_OLD_SOLARIS) stream->os_policy = OS_POLICY_SOLARIS; - SCLogDebug("Policy is %"PRIu8"", stream->os_policy); - + SCLogDebug("Policy is %" PRIu8 "", stream->os_policy); } /** @@ -5103,7 +5100,6 @@ static void StreamTcpPacketCheckPostRst(TcpSession *ssn, Packet *p) StreamTcpSetEvent(p, STREAM_SUSPECTED_RST_INJECT); return; } - return; } /** @@ -7069,8 +7065,6 @@ void TcpSessionSetReassemblyDepth(TcpSession *ssn, uint32_t size) if (size > ssn->reassembly_depth || size == 0) { ssn->reassembly_depth = size; } - - return; } const char *StreamTcpStateAsString(const enum TcpState state) diff --git a/src/tm-threads.c b/src/tm-threads.c index 032ceef45f..64c27a4235 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -681,7 +681,6 @@ void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data) b->slot_next = slot; } } - return; } #if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined sun @@ -1175,8 +1174,6 @@ void TmThreadAppend(ThreadVars *tv, int type) } SCMutexUnlock(&tv_root_lock); - - return; } static bool ThreadStillHasPackets(ThreadVars *tv) @@ -1340,7 +1337,6 @@ again: } SCMutexUnlock(&tv_root_lock); - return; } /** @@ -1455,7 +1451,6 @@ again: * don't process the last live packets together * with FFR packets */ TmThreadDrainPacketThreads(); - return; } #ifdef DEBUG_VALIDATION @@ -1526,7 +1521,6 @@ again: } } SCMutexUnlock(&tv_root_lock); - return; } #define MIN_WAIT_TIME 100 @@ -1567,8 +1561,6 @@ void TmThreadKillThreads(void) for (i = 0; i < TVT_MAX; i++) { TmThreadKillThreadsFamily(i); } - - return; } static void TmThreadFree(ThreadVars *tv) @@ -1734,8 +1726,6 @@ void TmThreadInitMC(ThreadVars *tv) FatalError("Error initializing the tv->cond condition " "variable"); } - - return; } static void TmThreadDeinitMC(ThreadVars *tv) @@ -1748,7 +1738,6 @@ static void TmThreadDeinitMC(ThreadVars *tv) SCCtrlCondDestroy(tv->ctrl_cond); SCFree(tv->ctrl_cond); } - return; } /** @@ -1767,8 +1756,6 @@ void TmThreadTestThreadUnPaused(ThreadVars *tv) if (TmThreadsCheckFlag(tv, THV_KILL)) break; } - - return; } /** @@ -1782,8 +1769,6 @@ void TmThreadWaitForFlag(ThreadVars *tv, uint32_t flags) while (!TmThreadsCheckFlag(tv, flags)) { SleepUsec(100); } - - return; } /** @@ -1794,7 +1779,6 @@ void TmThreadWaitForFlag(ThreadVars *tv, uint32_t flags) void TmThreadContinue(ThreadVars *tv) { TmThreadsUnsetFlag(tv, THV_PAUSE); - return; } static TmEcode WaitOnThreadsRunningByType(const int t) @@ -1939,7 +1923,6 @@ void TmThreadContinueThreads(void) } } SCMutexUnlock(&tv_root_lock); - return; } /** @@ -1958,7 +1941,6 @@ void TmThreadCheckThreadState(void) } } SCMutexUnlock(&tv_root_lock); - return; } /** diff --git a/src/tmqh-flow.c b/src/tmqh-flow.c index 54fb63725b..6ce4f29795 100644 --- a/src/tmqh-flow.c +++ b/src/tmqh-flow.c @@ -79,8 +79,6 @@ void TmqhFlowRegister(void) } else { tmqh_table[TMQH_FLOW].OutHandler = TmqhOutputFlowHash; } - - return; } void TmqhFlowPrintAutofpHandler(void) @@ -217,8 +215,6 @@ void TmqhOutputFlowFreeCtx(void *ctx) fctx->size); SCFree(fctx->queues); SCFree(fctx); - - return; } void TmqhOutputFlowHash(ThreadVars *tv, Packet *p) @@ -241,8 +237,6 @@ void TmqhOutputFlowHash(ThreadVars *tv, Packet *p) PacketEnqueue(q, p); SCCondSignal(&q->cond_q); SCMutexUnlock(&q->mutex_q); - - return; } /** @@ -271,8 +265,6 @@ void TmqhOutputFlowIPPair(ThreadVars *tv, Packet *p) PacketEnqueue(q, p); SCCondSignal(&q->cond_q); SCMutexUnlock(&q->mutex_q); - - return; } static void TmqhOutputFlowFTPHash(ThreadVars *tv, Packet *p) @@ -299,8 +291,6 @@ static void TmqhOutputFlowFTPHash(ThreadVars *tv, Packet *p) PacketEnqueue(q, p); SCCondSignal(&q->cond_q); SCMutexUnlock(&q->mutex_q); - - return; } #ifdef UNITTESTS @@ -413,6 +403,4 @@ void TmqhFlowRegisterTests(void) UtRegisterTest("TmqhOutputFlowSetupCtxTest03", TmqhOutputFlowSetupCtxTest03); #endif - - return; } diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index 48322bfb63..df27577252 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -438,8 +438,6 @@ void TmqhReleasePacketsToPacketPool(PacketQueue *pq) DEBUG_VALIDATE_BUG_ON(p->flow != NULL); TmqhOutputPacketpool(NULL, p); } - - return; } /** number of packets to keep reserved when calculating the pending diff --git a/src/unix-manager.c b/src/unix-manager.c index df53f3c2f2..38baaac220 100644 --- a/src/unix-manager.c +++ b/src/unix-manager.c @@ -1205,7 +1205,6 @@ void UnixManagerThreadSpawn(int mode) FatalError("Unix socket init failed"); } } - return; } // TODO can't think of a good name @@ -1268,7 +1267,6 @@ again: } SCMutexUnlock(&tv_root_lock); - return; } #else /* BUILD_UNIX_SOCKET */ @@ -1276,17 +1274,14 @@ again: void UnixManagerThreadSpawn(int mode) { SCLogError("Unix socket is not compiled"); - return; } void UnixSocketKillSocketThread(void) { - return; } void UnixManagerThreadSpawnNonRunmode(const bool unix_socket_enabled) { - return; } #endif /* BUILD_UNIX_SOCKET */ diff --git a/src/util-affinity.c b/src/util-affinity.c index 06256db5b8..8a224711e8 100644 --- a/src/util-affinity.c +++ b/src/util-affinity.c @@ -92,7 +92,6 @@ static void AffinitySetupInit(void) } SCMutexInit(&thread_affinity[i].taf_mutex, NULL); } - return; } void BuildCpusetWithCallback(const char *name, ConfNode *node, diff --git a/src/util-atomic.c b/src/util-atomic.c index 11aa51afd0..f5aa4a2979 100644 --- a/src/util-atomic.c +++ b/src/util-atomic.c @@ -69,6 +69,4 @@ void SCAtomicRegisterTests(void) #ifdef UNITTESTS UtRegisterTest("SCAtomicTest01", SCAtomicTest01); #endif - - return; } diff --git a/src/util-buffer.c b/src/util-buffer.c index 05b3658258..677805b400 100644 --- a/src/util-buffer.c +++ b/src/util-buffer.c @@ -81,8 +81,6 @@ int MemBufferExpand(MemBuffer **buffer, uint32_t expand_by) { void MemBufferFree(MemBuffer *buffer) { SCFree(buffer); - - return; } void MemBufferPrintToFP(MemBuffer *buffer, FILE *fp) diff --git a/src/util-classification-config.c b/src/util-classification-config.c index e4dc6d5190..07f18c2caa 100644 --- a/src/util-classification-config.c +++ b/src/util-classification-config.c @@ -76,7 +76,6 @@ void SCClassConfInit(DetectEngineCtx *de_ctx) } de_ctx->class_conf_regex_match = pcre2_match_data_create_from_pattern(de_ctx->class_conf_regex, NULL); - return; } void SCClassConfDeinit(DetectEngineCtx *de_ctx) @@ -194,8 +193,6 @@ void SCClassConfDeInitContext(DetectEngineCtx *de_ctx) HashTableFree(de_ctx->class_conf_ht); de_ctx->class_conf_ht = NULL; - - return; } /** @@ -435,8 +432,6 @@ static void SCClassConfDeAllocClasstype(SCClassConfClasstype *ct) SCFree(ct); } - - return; } /** @@ -512,8 +507,6 @@ char SCClassConfClasstypeHashCompareFunc(void *data1, uint16_t datalen1, void SCClassConfClasstypeHashFree(void *ch) { SCClassConfDeAllocClasstype(ch); - - return; } /** diff --git a/src/util-debug-filters.c b/src/util-debug-filters.c index 65074fac0e..8995015459 100644 --- a/src/util-debug-filters.c +++ b/src/util-debug-filters.c @@ -378,8 +378,6 @@ void SCLogReleaseFGFilters(void) SCMutexUnlock(&sc_log_fg_filters_m[i]); sc_log_fg_filters[i] = NULL; } - - return; } /** @@ -628,8 +626,6 @@ void SCLogCheckFDFilterExit(const char *function) if (thread_list != NULL) thread_list->entered--; - - return; } /** @@ -715,9 +711,7 @@ void SCLogReleaseFDFilters(void) sc_log_fd_filters = NULL; - SCMutexUnlock( &sc_log_fd_filters_m ); - - return; + SCMutexUnlock(&sc_log_fd_filters_m); } /** @@ -874,8 +868,6 @@ void SCLogAddToFGFFileList(SCLogFGFilterFile *fgf_file, sc_log_fg_filters[listtype] = fgf_file_temp; else fgf_file->next = fgf_file_temp; - - return; } /** @@ -921,8 +913,6 @@ void SCLogAddToFGFFuncList(SCLogFGFilterFile *fgf_file, fgf_file->func = fgf_func_temp; else fgf_func->next = fgf_func_temp; - - return; } /** @@ -955,8 +945,6 @@ void SCLogAddToFGFLineList(SCLogFGFilterFunc *fgf_func, fgf_func->line = fgf_line_temp; else fgf_line->next = fgf_line_temp; - - return; } /** @@ -971,7 +959,4 @@ void SCLogReleaseFDFilter(SCLogFDFilter *fdf) SCFree(fdf->func); SCFree(fdf); } - - return; } - diff --git a/src/util-debug.c b/src/util-debug.c index c62a0104dd..f2a7b2dd21 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -173,8 +173,6 @@ static inline void SCLogPrintToStream(FILE *fd, char *msg) #if defined (OS_WIN32) SCMutexUnlock(&sc_log_stream_lock); #endif /* OS_WIN32 */ - - return; } /** @@ -193,8 +191,6 @@ static inline void SCLogPrintToSyslog(int syslog_log_level, const char *msg) //syslog_r(syslog_log_level, NULL, "%s", msg); syslog(syslog_log_level, "%s", msg); - - return; } /** @@ -1031,8 +1027,6 @@ static inline void SCLogFreeLogOPIfaceCtx(SCLogOPIfaceCtx *iface_ctx) SCFree(temp); } - - return; } /** @@ -1071,8 +1065,6 @@ static inline void SCLogSetLogLevel(SCLogInitData *sc_lid, SCLogConfig *sc_lc) /* we also set it to a global var, as it is easier to access it */ sc_log_global_log_level = sc_lc->log_level; - - return; } SCLogLevel SCLogGetLogLevel(void) @@ -1130,8 +1122,6 @@ static inline void SCLogSetLogFormat(SCLogInitData *sc_lid, SCLogConfig *sc_lc) printf("Error allocating memory\n"); exit(EXIT_FAILURE); } - - return; } /** @@ -1203,7 +1193,6 @@ static inline void SCLogSetOPIface(SCLogInitData *sc_lid, SCLogConfig *sc_lc) sc_lc->op_ifaces = op_ifaces_ctx; sc_lc->op_ifaces_cnt++; } - return; } /** @@ -1248,8 +1237,6 @@ static inline void SCLogSetOPFilter(SCLogInitData *sc_lid, SCLogConfig *sc_lc) sc_lc->op_filter_regex_match = pcre2_match_data_create_from_pattern(sc_lc->op_filter_regex, NULL); } - - return; } /** @@ -1283,8 +1270,6 @@ static void SCLogFreeLogInitData(SCLogInitData *sc_lid) SCLogFreeLogOPIfaceCtx(sc_lid->op_ifaces); SCFree(sc_lid); } - - return; } #endif #endif @@ -1310,8 +1295,6 @@ static inline void SCLogFreeLogConfig(SCLogConfig *sc_lc) SCLogFreeLogOPIfaceCtx(sc_lc->op_ifaces); SCFree(sc_lc); } - - return; } /** @@ -1344,8 +1327,6 @@ void SCLogAppendOPIfaceCtx(SCLogOPIfaceCtx *iface_ctx, SCLogInitData *sc_lid) prev->next = iface_ctx; sc_lid->op_ifaces_cnt++; - - return; } #ifdef UNITTESTS @@ -1434,7 +1415,6 @@ void SCLogInitLogModule(SCLogInitData *sc_lid) //SCOutputPrint(sc_did->startup_message); rs_log_set_level(sc_log_global_log_level); - return; } void SCLogLoadConfig(int daemon, int verbose, uint32_t userid, uint32_t groupid) @@ -1632,8 +1612,6 @@ void SCLogDeInitLogModule(void) #if defined (OS_WIN32) SCMutexDestroy(&sc_log_stream_lock); #endif /* OS_WIN32 */ - - return; } //------------------------------------Unit_Tests-------------------------------- diff --git a/src/util-ebpf.c b/src/util-ebpf.c index 9029335301..ea0811b89a 100644 --- a/src/util-ebpf.c +++ b/src/util-ebpf.c @@ -586,7 +586,6 @@ void EBPFBypassFree(void *data) SCFree(eb->key[1]); } SCFree(eb); - return; } /** diff --git a/src/util-host-os-info.c b/src/util-host-os-info.c index 02b3ee72a2..efbf8024d4 100644 --- a/src/util-host-os-info.c +++ b/src/util-host-os-info.c @@ -101,8 +101,6 @@ static void SCHInfoFreeUserDataOSPolicy(void *data) { if (data != NULL) SCFree(data); - - return; } /** @@ -323,8 +321,6 @@ void SCHInfoCleanResources(void) SCRadixReleaseRadixTree(sc_hinfo_tree); sc_hinfo_tree = NULL; } - - return; } /** @@ -364,16 +360,12 @@ static void SCHInfoCreateContextBackup(void) { sc_hinfo_tree_backup = sc_hinfo_tree; sc_hinfo_tree = NULL; - - return; } static void SCHInfoRestoreContextBackup(void) { sc_hinfo_tree = sc_hinfo_tree_backup; sc_hinfo_tree_backup = NULL; - - return; } /** @@ -1637,5 +1629,4 @@ void SCHInfoRegisterTests(void) UtRegisterTest("SCHInfoTestLoadFromConfig04", SCHInfoTestLoadFromConfig04); UtRegisterTest("SCHInfoTestLoadFromConfig05", SCHInfoTestLoadFromConfig05); #endif /* UNITTESTS */ - } diff --git a/src/util-ip.c b/src/util-ip.c index 8d482d90ed..8792253cc3 100644 --- a/src/util-ip.c +++ b/src/util-ip.c @@ -200,6 +200,4 @@ void MaskIPNetblock(uint8_t *stream, int netmask, int key_bitlen) } stream[i] &= mask; } - - return; } diff --git a/src/util-landlock.c b/src/util-landlock.c index 258993c30d..245be5634f 100644 --- a/src/util-landlock.c +++ b/src/util-landlock.c @@ -33,7 +33,6 @@ void LandlockSandboxing(SCInstance *suri) { - return; } #else /* HAVE_LINUX_LANDLOCK_H */ diff --git a/src/util-macset.c b/src/util-macset.c index 7902e06197..bf3edf0572 100644 --- a/src/util-macset.c +++ b/src/util-macset.c @@ -428,6 +428,4 @@ void MacSetRegisterTests(void) UtRegisterTest("MacSetTest04", MacSetTest04); UtRegisterTest("MacSetTest05", MacSetTest05); #endif - - return; } diff --git a/src/util-mpm-ac.c b/src/util-mpm-ac.c index 27d5ff0643..6e115acaa3 100644 --- a/src/util-mpm-ac.c +++ b/src/util-mpm-ac.c @@ -107,9 +107,7 @@ static void SCACGetConfig(void) //ConfNode *ac_conf; //const char *hash_val = NULL; - //ConfNode *pm = ConfGetNode("pattern-matcher"); - - return; + // ConfNode *pm = ConfGetNode("pattern-matcher"); } /** @@ -274,8 +272,6 @@ static void SCACSetOutputState(int32_t state, uint32_t pid, MpmCtx *mpm_ctx) output_state->pids = ptmp; output_state->pids[output_state->no_of_entries - 1] = pid; - - return; } /** @@ -318,8 +314,6 @@ static inline void SCACEnter(uint8_t *pattern, uint16_t pattern_len, uint32_t pi /* add this pattern id, to the output table of the last state, where the * pattern ends in the trie */ SCACSetOutputState(state, pid, mpm_ctx); - - return; } /** @@ -345,8 +339,6 @@ static inline void SCACCreateGotoTable(MpmCtx *mpm_ctx) ctx->goto_table[0][ascii_code] = 0; } } - - return; } static inline void SCACDetermineLevel1Gap(MpmCtx *mpm_ctx) @@ -366,8 +358,6 @@ static inline void SCACDetermineLevel1Gap(MpmCtx *mpm_ctx) int32_t newstate = SCACInitNewState(mpm_ctx); ctx->goto_table[0][u] = newstate; } - - return; } static inline int SCACStateQueueIsEmpty(StateQueue *q) @@ -396,8 +386,6 @@ static inline void SCACEnqueue(StateQueue *q, int32_t state) if (q->top == q->bot) { FatalError("Just ran out of space in the queue. Please file a bug report on this"); } - - return; } static inline int32_t SCACDequeue(StateQueue *q) @@ -454,8 +442,6 @@ static inline void SCACClubOutputStates(int32_t dst_state, int32_t src_state, output_src_state->pids[i]; } } - - return; } /** @@ -512,8 +498,6 @@ static inline void SCACCreateFailureTable(MpmCtx *mpm_ctx) } } SCFree(q); - - return; } /** @@ -606,8 +590,6 @@ static inline void SCACCreateDeltaTable(MpmCtx *mpm_ctx) } SCFree(q); } - - return; } static inline void SCACClubOutputStatePresenceWithDeltaTable(MpmCtx *mpm_ctx) @@ -636,8 +618,6 @@ static inline void SCACClubOutputStatePresenceWithDeltaTable(MpmCtx *mpm_ctx) } } } - - return; } static inline void SCACInsertCaseSensitiveEntriesForPatterns(MpmCtx *mpm_ctx) @@ -657,8 +637,6 @@ static inline void SCACInsertCaseSensitiveEntriesForPatterns(MpmCtx *mpm_ctx) } } } - - return; } #if 0 @@ -676,8 +654,6 @@ static void SCACPrintDeltaTable(MpmCtx *mpm_ctx) } } } - - return; } #endif @@ -719,8 +695,6 @@ static void SCACPrepareStateTable(MpmCtx *mpm_ctx) ctx->goto_table = NULL; SCFree(ctx->failure_table); ctx->failure_table = NULL; - - return; } /** @@ -921,8 +895,6 @@ void SCACDestroyCtx(MpmCtx *mpm_ctx) mpm_ctx->ctx = NULL; mpm_ctx->memory_cnt--; mpm_ctx->memory_size -= sizeof(SCACCtx); - - return; } /** @@ -1114,8 +1086,6 @@ void SCACPrintInfo(MpmCtx *mpm_ctx) printf("Largest: %" PRIu32 "\n", mpm_ctx->maxlen); printf("Total states in the state table: %" PRIu32 "\n", ctx->state_count); printf("\n"); - - return; } @@ -1138,7 +1108,6 @@ void MpmACRegister(void) mpm_table[MPM_AC].RegisterUnittests = SCACRegisterTests; #endif mpm_table[MPM_AC].feature_flags = MPM_FEATURE_FLAG_DEPTH | MPM_FEATURE_FLAG_OFFSET; - return; } /*************************************Unittests********************************/ diff --git a/src/util-mpm-hs.c b/src/util-mpm-hs.c index b22b6f869d..82b91b4ec0 100644 --- a/src/util-mpm-hs.c +++ b/src/util-mpm-hs.c @@ -1001,7 +1001,6 @@ int SCHSAddPatternCS(MpmCtx *mpm_ctx, uint8_t *pat, uint16_t patlen, void SCHSPrintSearchStats(MpmThreadCtx *mpm_thread_ctx) { - return; } void SCHSPrintInfo(MpmCtx *mpm_ctx) diff --git a/src/util-napatech.c b/src/util-napatech.c index affcd49cbb..bb09dcd8ef 100644 --- a/src/util-napatech.c +++ b/src/util-napatech.c @@ -1216,8 +1216,6 @@ void NapatechStartStats(void) if (TmThreadSpawn(buf_monitor_tv) != 0) { FatalError("Failed to spawn thread for NapatechBufMonitor - Killing engine."); } - - return; } bool NapatechSetupNuma(uint32_t stream, uint32_t numa) diff --git a/src/util-pool.c b/src/util-pool.c index 1d7523f75b..11069a7886 100644 --- a/src/util-pool.c +++ b/src/util-pool.c @@ -389,7 +389,6 @@ static int PoolTestInitArg(void *data, void *allocdata) static void PoolTestFree(void *ptr) { - return; } static int PoolTestInit01 (void) diff --git a/src/util-port-interval-tree.c b/src/util-port-interval-tree.c index 57fe1094f2..e45a55eb23 100644 --- a/src/util-port-interval-tree.c +++ b/src/util-port-interval-tree.c @@ -300,7 +300,6 @@ error: DetectPortFree(de_ctx, new_port); if (stack != NULL) SCFree(stack); - return; } /** diff --git a/src/util-print.c b/src/util-print.c index 4ca901fa0c..65de27eb38 100644 --- a/src/util-print.c +++ b/src/util-print.c @@ -107,8 +107,6 @@ void PrintRawUriBuf(char *retbuf, uint32_t *offset, uint32_t retbuflen, "\\x%02X", buf[u]); } } - - return; } void PrintRawDataFp(FILE *fp, const uint8_t *buf, uint32_t buflen) @@ -192,8 +190,6 @@ void PrintRawDataToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32 } if (ch != 16) PrintBufferData((char *)dst_buf, dst_buf_offset_ptr, dst_buf_size, "\n"); - - return; } void PrintStringsToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size, @@ -208,8 +204,6 @@ void PrintStringsToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32 } } dst_buf[dst_buf_size - 1] = 0; - - return; } static const char *PrintInetIPv6(const void *src, char *dst, socklen_t size) diff --git a/src/util-profiling-locks.c b/src/util-profiling-locks.c index 00f9ef652a..5215b4ec2d 100644 --- a/src/util-profiling-locks.c +++ b/src/util-profiling-locks.c @@ -136,8 +136,6 @@ static void LockRecordAdd(ProfilingLock *l) lookup_fn->ticks_cnt++; lookup_fn->cont += l->cont; } - - return; } /** \param p void ptr to Packet struct */ @@ -239,4 +237,3 @@ void LockRecordFreeHash(void) #endif #endif - diff --git a/src/util-proto-name.c b/src/util-proto-name.c index 41423c9477..c6d91ae76d 100644 --- a/src/util-proto-name.c +++ b/src/util-proto-name.c @@ -401,7 +401,6 @@ static void ProtoNameAddEntry(const char *proto_name, const uint8_t proto_number "name: \"%s\"; number: %d", proto_ent->name, proto_ent->number); } - return; } static void ProtoNameHashFreeFunc(void *data) diff --git a/src/util-radix-tree.c b/src/util-radix-tree.c index 0362f21f29..0f570fdbc9 100644 --- a/src/util-radix-tree.c +++ b/src/util-radix-tree.c @@ -68,8 +68,6 @@ static SCRadixUserData *SCRadixAllocSCRadixUserData(uint8_t netmask, void *user) static void SCRadixDeAllocSCRadixUserData(SCRadixUserData *user_data) { SCFree(user_data); - - return; } /** @@ -108,8 +106,6 @@ static void SCRadixAppendToSCRadixUserDataList(SCRadixUserData *new, new->next = prev->next; prev->next = new; } - - return; } /** @@ -185,10 +181,8 @@ static void SCRadixAddNetmaskUserDataToPrefix(SCRadixPrefix *prefix, FatalError("prefix or user NULL"); } - SCRadixAppendToSCRadixUserDataList(SCRadixAllocSCRadixUserData(netmask, user), - &prefix->user_data); - - return; + SCRadixAppendToSCRadixUserDataList( + SCRadixAllocSCRadixUserData(netmask, user), &prefix->user_data); } /** @@ -222,8 +216,6 @@ static void SCRadixRemoveNetmaskUserDataFromPrefix(SCRadixPrefix *prefix, prev = temp; temp = temp->next; } - - return; } /** @@ -363,8 +355,6 @@ static void SCRadixReleasePrefix(SCRadixPrefix *prefix, SCRadixTree *tree) SCFree(prefix); } - - return; } /** @@ -400,8 +390,6 @@ static void SCRadixReleaseNode(SCRadixNode *node, SCRadixTree *tree) SCFree(node); } - - return; } /** @@ -442,8 +430,6 @@ static void SCRadixReleaseRadixSubtree(SCRadixNode *node, SCRadixTree *tree) SCRadixReleaseRadixSubtree(node->right, tree); SCRadixReleaseNode(node, tree); } - - return; } /** @@ -459,7 +445,6 @@ void SCRadixReleaseRadixTree(SCRadixTree *tree) SCRadixReleaseRadixSubtree(tree->head, tree); tree->head = NULL; SCFree(tree); - return; } /** @@ -1152,8 +1137,6 @@ static void SCRadixTransferNetmasksBWNodes(SCRadixNode *dest, SCRadixNode *src) for (i = dest->netmask_cnt, j = 0; j < src->netmask_cnt; i++, j++) dest->netmasks[i] = src->netmasks[j]; - - return; } /** @@ -1214,8 +1197,6 @@ static void SCRadixRemoveNetblockEntry(SCRadixNode *node, uint8_t netmask) return; } node->netmasks = ptmp; - - return; } /** @@ -1351,8 +1332,6 @@ static void SCRadixRemoveKey(uint8_t *key_stream, uint16_t key_bitlen, SCRadixReleaseNode(parent, tree); SCRadixReleaseNode(node, tree); SCRadixReleasePrefix(prefix, tree); - - return; } /** @@ -1370,7 +1349,6 @@ void SCRadixRemoveKeyIPV4Netblock(uint8_t *key_stream, SCRadixTree *tree, SCRadixValidateIPv4Key(key_stream, netmask); #endif SCRadixRemoveKey(key_stream, 32, tree, netmask); - return; } /** @@ -1386,7 +1364,6 @@ void SCRadixRemoveKeyIPV4Netblock(uint8_t *key_stream, SCRadixTree *tree, void SCRadixRemoveKeyIPV4(uint8_t *key_stream, SCRadixTree *tree) { SCRadixRemoveKey(key_stream, 32, tree, 32); - return; } /** @@ -1404,7 +1381,6 @@ void SCRadixRemoveKeyIPV6Netblock(uint8_t *key_stream, SCRadixTree *tree, SCRadixValidateIPv6Key(key_stream, netmask); #endif SCRadixRemoveKey(key_stream, 128, tree, netmask); - return; } /** @@ -1420,7 +1396,6 @@ void SCRadixRemoveKeyIPV6Netblock(uint8_t *key_stream, SCRadixTree *tree, void SCRadixRemoveKeyIPV6(uint8_t *key_stream, SCRadixTree *tree) { SCRadixRemoveKey(key_stream, 128, tree, 128); - return; } /** @@ -1683,8 +1658,6 @@ void SCRadixPrintNodeInfo(SCRadixNode *node, int level, void (*PrintData)(void* } else { printf("inter_node)\n"); } - - return; } /** @@ -1701,8 +1674,6 @@ static void SCRadixPrintRadixSubtree(SCRadixNode *node, int level, void (*PrintD SCRadixPrintRadixSubtree(node->left, level + 1, PrintData); SCRadixPrintRadixSubtree(node->right, level + 1, PrintData); } - - return; } /** @@ -1728,8 +1699,6 @@ void SCRadixPrintTree(SCRadixTree *tree) printf("Printing the Radix Tree: \n"); SCRadixPrintRadixSubtree(tree->head, 0, tree->PrintData); - - return; } /*------------------------------------Unit_Tests------------------------------*/ @@ -3832,6 +3801,4 @@ void SCRadixRegisterTests(void) UtRegisterTest("SCRadixTestIPV4NetblockInsertion26", SCRadixTestIPV4NetblockInsertion26); #endif - - return; } diff --git a/src/util-reference-config.c b/src/util-reference-config.c index 8a84af57d6..1f7dc39573 100644 --- a/src/util-reference-config.c +++ b/src/util-reference-config.c @@ -67,7 +67,6 @@ void SCReferenceConfInit(DetectEngineCtx *de_ctx) } de_ctx->reference_conf_regex_match = pcre2_match_data_create_from_pattern(de_ctx->reference_conf_regex, NULL); - return; } void SCReferenceConfDeinit(DetectEngineCtx *de_ctx) @@ -183,8 +182,6 @@ void SCRConfDeInitContext(DetectEngineCtx *de_ctx) HashTableFree(de_ctx->reference_conf_ht); de_ctx->reference_conf_ht = NULL; - - return; } /** @@ -395,8 +392,6 @@ void SCRConfDeAllocSCRConfReference(SCRConfReference *ref) SCFree(ref); } - - return; } /** @@ -472,8 +467,6 @@ char SCRConfReferenceHashCompareFunc(void *data1, uint16_t datalen1, void SCRConfReferenceHashFree(void *data) { SCRConfDeAllocSCRConfReference(data); - - return; } /** @@ -790,6 +783,4 @@ void SCRConfRegisterTests(void) UtRegisterTest("SCRConfTest05", SCRConfTest05); UtRegisterTest("SCRConfTest06", SCRConfTest06); #endif /* UNITTESTS */ - - return; } diff --git a/src/util-rule-vars.c b/src/util-rule-vars.c index e526035d03..47193c2d26 100644 --- a/src/util-rule-vars.c +++ b/src/util-rule-vars.c @@ -407,6 +407,4 @@ void SCRuleVarsRegisterTests(void) UtRegisterTest("SCRuleVarsMTest01", SCRuleVarsMTest01); #endif - - return; } diff --git a/src/util-signal.c b/src/util-signal.c index f96190f9ae..30a9206b8e 100644 --- a/src/util-signal.c +++ b/src/util-signal.c @@ -71,6 +71,4 @@ void UtilSignalHandlerSetup(int sig, void (*handler)(int)) action.sa_flags = 0; sigaction(sig, &action, 0); #endif /* OS_WIN32 */ - - return; } diff --git a/src/util-streaming-buffer.c b/src/util-streaming-buffer.c index 6f9146269b..0497e70769 100644 --- a/src/util-streaming-buffer.c +++ b/src/util-streaming-buffer.c @@ -1690,7 +1690,6 @@ void StreamingBufferSBBGetData(const StreamingBuffer *sb, } *data = NULL; *data_len = 0; - return; } /** \brief get the data for one SBB */ @@ -1733,7 +1732,6 @@ void StreamingBufferSBBGetDataAtOffset(const StreamingBuffer *sb, *data = NULL; *data_len = 0; - return; } void StreamingBufferSegmentGetData(const StreamingBuffer *sb, @@ -1763,7 +1761,6 @@ void StreamingBufferSegmentGetData(const StreamingBuffer *sb, } *data = NULL; *data_len = 0; - return; } /** diff --git a/src/util-thash.c b/src/util-thash.c index 6443990bc2..a17679605a 100644 --- a/src/util-thash.c +++ b/src/util-thash.c @@ -372,7 +372,6 @@ void THashShutdown(THashTableContext *ctx) (void) SC_ATOMIC_SUB(ctx->memuse, ctx->config.hash_size * sizeof(THashHashRow)); THashDataQueueDestroy(&ctx->spare_q); SCFree(ctx); - return; } /** \brief Walk the hash @@ -446,7 +445,6 @@ void THashCleanup(THashTableContext *ctx) } HRLOCK_UNLOCK(hb); } - return; } /* calculate the hash key for this packet diff --git a/src/util-threshold-config.c b/src/util-threshold-config.c index 79663e8db9..a85faad14f 100644 --- a/src/util-threshold-config.c +++ b/src/util-threshold-config.c @@ -208,7 +208,6 @@ static void SCThresholdConfDeInitContext(DetectEngineCtx *de_ctx, FILE *fd) { if (fd != NULL) fclose(fd); - return; } /** \internal diff --git a/src/util-unittest.c b/src/util-unittest.c index d4ef5dc99c..7f764fd5c7 100644 --- a/src/util-unittest.c +++ b/src/util-unittest.c @@ -283,8 +283,6 @@ void UtCleanup(void) void UtRunModeRegister(void) { RunModeRegisterNewRunMode(RUNMODE_UNITTEST, "unittest", "Unittest mode", NULL, NULL); - - return; } /*