[PATCH nf-next v2 6/6] netfilter: nf_log: replace u_int8_t with u8

From: Carlos Grillet

Date: Mon Jun 15 2026 - 09:42:17 EST


Replace POSIX u_int8_t with preferred kernel type u8 and update typedef
and declaration in include/net/netfilter/nf_log.h

No functional changes.

Signed-off-by: Carlos Grillet <carlos@xxxxxxxxxxxxxxxx>
---
include/net/netfilter/nf_log.h | 16 ++++++++--------
net/netfilter/nf_log.c | 14 +++++++-------
2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h
index 00506792a06d..cff636f29f45 100644
--- a/include/net/netfilter/nf_log.h
+++ b/include/net/netfilter/nf_log.h
@@ -37,7 +37,7 @@ struct nf_loginfo {
};

typedef void nf_logfn(struct net *net,
- u_int8_t pf,
+ u8 pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
@@ -56,18 +56,18 @@ struct nf_logger {
extern int sysctl_nf_log_all_netns;

/* Function to register/unregister log function. */
-int nf_log_register(u_int8_t pf, struct nf_logger *logger);
+int nf_log_register(u8 pf, struct nf_logger *logger);
void nf_log_unregister(struct nf_logger *logger);

/* Check if any logger is registered for a given protocol family. */
-bool nf_log_is_registered(u_int8_t pf);
+bool nf_log_is_registered(u8 pf);

-int nf_log_set(struct net *net, u_int8_t pf, const struct nf_logger *logger);
+int nf_log_set(struct net *net, u8 pf, const struct nf_logger *logger);
void nf_log_unset(struct net *net, const struct nf_logger *logger);

-int nf_log_bind_pf(struct net *net, u_int8_t pf,
+int nf_log_bind_pf(struct net *net, u8 pf,
const struct nf_logger *logger);
-void nf_log_unbind_pf(struct net *net, u_int8_t pf);
+void nf_log_unbind_pf(struct net *net, u8 pf);

int nf_logger_find_get(int pf, enum nf_log_type type);
void nf_logger_put(int pf, enum nf_log_type type);
@@ -78,7 +78,7 @@ void nf_logger_put(int pf, enum nf_log_type type);
/* Calls the registered backend logging function */
__printf(8, 9)
void nf_log_packet(struct net *net,
- u_int8_t pf,
+ u8 pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
@@ -88,7 +88,7 @@ void nf_log_packet(struct net *net,

__printf(8, 9)
void nf_log_trace(struct net *net,
- u_int8_t pf,
+ u8 pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index f4d80654dfe6..978e082a91b5 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -42,7 +42,7 @@ static struct nf_logger *__find_logger(int pf, const char *str_logger)
return NULL;
}

-int nf_log_set(struct net *net, u_int8_t pf, const struct nf_logger *logger)
+int nf_log_set(struct net *net, u8 pf, const struct nf_logger *logger)
{
const struct nf_logger *log;

@@ -76,7 +76,7 @@ void nf_log_unset(struct net *net, const struct nf_logger *logger)
EXPORT_SYMBOL(nf_log_unset);

/* return EEXIST if the same logger is registered, 0 on success. */
-int nf_log_register(u_int8_t pf, struct nf_logger *logger)
+int nf_log_register(u8 pf, struct nf_logger *logger)
{
int i;
int ret = 0;
@@ -133,7 +133,7 @@ EXPORT_SYMBOL(nf_log_unregister);
*
* Returns: true if at least one logger is active for @pf, false otherwise.
*/
-bool nf_log_is_registered(u_int8_t pf)
+bool nf_log_is_registered(u8 pf)
{
int i;

@@ -151,7 +151,7 @@ bool nf_log_is_registered(u_int8_t pf)
}
EXPORT_SYMBOL(nf_log_is_registered);

-int nf_log_bind_pf(struct net *net, u_int8_t pf,
+int nf_log_bind_pf(struct net *net, u8 pf,
const struct nf_logger *logger)
{
if (pf >= ARRAY_SIZE(net->nf.nf_loggers))
@@ -167,7 +167,7 @@ int nf_log_bind_pf(struct net *net, u_int8_t pf,
}
EXPORT_SYMBOL(nf_log_bind_pf);

-void nf_log_unbind_pf(struct net *net, u_int8_t pf)
+void nf_log_unbind_pf(struct net *net, u8 pf)
{
if (pf >= ARRAY_SIZE(net->nf.nf_loggers))
return;
@@ -235,7 +235,7 @@ void nf_logger_put(int pf, enum nf_log_type type)
EXPORT_SYMBOL_GPL(nf_logger_put);

void nf_log_packet(struct net *net,
- u_int8_t pf,
+ u8 pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
@@ -264,7 +264,7 @@ void nf_log_packet(struct net *net,
EXPORT_SYMBOL(nf_log_packet);

void nf_log_trace(struct net *net,
- u_int8_t pf,
+ u8 pf,
unsigned int hooknum,
const struct sk_buff *skb,
const struct net_device *in,
--
2.54.0