From 7901730ddfff17e11e8304a6e02916ff15cd3dda Mon Sep 17 00:00:00 2001
From: Filip Matusiak <filip.matusiak@iopsys.eu>
Date: Wed, 4 Dec 2024 10:49:25 +0100
Subject: [PATCH] Warn on misalligned station counter when flushing stalist

---
 src/cntlr.c     | 6 +++---
 src/cntlr_map.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cntlr.c b/src/cntlr.c
index ef8938df..4136520d 100644
--- a/src/cntlr.c
+++ b/src/cntlr.c
@@ -879,8 +879,9 @@ static void node_clean_stalist(struct controller *c, struct node *n)
 		cntlr_remove_sta(c, n, s);
 	}
 
-	if (n->sta_count != 0) {
-		err("%s: Misalligned station counter!\n", __func__);
+	if (WARN_ON(n->sta_count != 0)) {
+		err("%s: Misalligned station counter (cnt=%d)!\n",
+		    __func__, n->sta_count);
 		n->sta_count = 0;
 	}
 }
@@ -1433,7 +1434,6 @@ static void cntlr_metric_collection(struct controller *c)
 
 	cntlr_get_all_sta_metrics(c);
 
-
 	/* TODO: */
 	//forall_node_get_usta_metrics(c);
 
diff --git a/src/cntlr_map.c b/src/cntlr_map.c
index f335fd3b..b26ba55c 100644
--- a/src/cntlr_map.c
+++ b/src/cntlr_map.c
@@ -4030,7 +4030,7 @@ int cntlr_handle_map_event(void *module, uint16_t cmdutype, uint16_t mid,
 			return -1;
 	}
 
-	/*update the timestamp of the node*/
+	/* update the timestamp of the node */
 	if (n)
 		timestamp_update(&n->last_tsp_seen);
 
-- 
GitLab