From 73a35c73270301ceafc34751badfac1bee5f3352 Mon Sep 17 00:00:00 2001 From: huoji Date: Sat, 2 Dec 2023 22:23:47 +0800 Subject: [PATCH] fix gcc error in c90 --- linux_kernel/ip_hashmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux_kernel/ip_hashmap.c b/linux_kernel/ip_hashmap.c index 3ca10e8..57c092c 100644 --- a/linux_kernel/ip_hashmap.c +++ b/linux_kernel/ip_hashmap.c @@ -6,14 +6,14 @@ void thread_demon_ip_hashmap(void *ctx) { struct hlist_head *head; struct hlist_node *node, *tmp; struct ip_hashmap_node_t *data; - + int i = 0; while (!kthread_should_stop()) { msleep_interruptible(30000); // 每 30 秒执行一次清理操作 const s64 current_time_sec = ktime_get_real_seconds(); spin_lock(&g_ip_hashtable.lock); - for (int i = 0; i < g_ip_hashtable.bucket_num; ++i) { + for (i = 0; i < g_ip_hashtable.bucket_num; ++i) { head = &g_ip_hashtable.heads[i]; hlist_for_each_safe(node, tmp, head) { data = container_of(node, struct ip_hashmap_node_t, node);