git: 745b6ca4ed93 - stable/15 - ipfw: Use proper prototype for SYSINIT functions

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Sat, 31 Jan 2026 17:04:24 UTC
The branch stable/15 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=745b6ca4ed933f9f4c1d314dc7b0aa31e8e9e0de

commit 745b6ca4ed933f9f4c1d314dc7b0aa31e8e9e0de
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-10-13 10:12:33 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2026-01-31 17:01:05 +0000

    ipfw: Use proper prototype for SYSINIT functions
    
    The only possible return value of function ipfw_init() is 0. Make it
    return void to match the prototype of SYSINIT.
    
    MFC after:      1 week
    
    (cherry picked from commit 1bba2194c8a960235f8eae36e7d3e96f347ce779)
---
 sys/netpfil/ipfw/ip_fw2.c    | 9 +++------
 sys/netpfil/ipfw/ip_fw_nat.c | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c
index 2b7f38d2e9a6..c27b6bc274fb 100644
--- a/sys/netpfil/ipfw/ip_fw2.c
+++ b/sys/netpfil/ipfw/ip_fw2.c
@@ -3578,11 +3578,9 @@ sysctl_ipfw_tables_sets(SYSCTL_HANDLER_ARGS)
 /*
  * Stuff that must be initialised only on boot or module load
  */
-static int
-ipfw_init(void)
+static void
+ipfw_init(void *dummy __unused)
 {
-	int error = 0;
-
 	/*
  	 * Only print out this stuff the first time around,
 	 * when called from the sysinit code.
@@ -3627,14 +3625,13 @@ ipfw_init(void)
 	ipfw_init_sopt_handler();
 	ipfw_init_obj_rewriter();
 	ipfw_iface_init();
-	return (error);
 }
 
 /*
  * Called for the removal of the last instance only on module unload.
  */
 static void
-ipfw_destroy(void)
+ipfw_destroy(void *dummy __unused)
 {
 
 	ipfw_iface_destroy();
diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c
index 19393d5b8444..8bd27f6885ab 100644
--- a/sys/netpfil/ipfw/ip_fw_nat.c
+++ b/sys/netpfil/ipfw/ip_fw_nat.c
@@ -1168,7 +1168,7 @@ vnet_ipfw_nat_uninit(const void *arg __unused)
 }
 
 static void
-ipfw_nat_init(void)
+ipfw_nat_init(void *dummy __unused)
 {
 
 	/* init ipfw hooks */
@@ -1185,7 +1185,7 @@ ipfw_nat_init(void)
 }
 
 static void
-ipfw_nat_destroy(void)
+ipfw_nat_destroy(void *dummy __unused)
 {
 
 	EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_event_tag);