Skip to contentSkip to conversation

tools/vm/slabinfo: fix an unintentional printf

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 15, 2016 – Jul 16, 2016 Kernel janitors

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/vm/slabinfo: fix an unintentional printf

The curly braces are missing here so we print stuff unintentionally.

Fixes 9da4714a2d4f ('slub: slabinfo update for cmpxchg handling')
tools/vm/slabinfo.c +2 -1
index 7cf6e17..b9d34b3 100644
@@ -510,10 +510,11 @@ static void slab_stats(struct slabinfo *s)
 			s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total);
 	}
 
-	if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail)
+	if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) {
 		printf("\nCmpxchg_double Looping\n------------------------\n");
 		printf("Locked Cmpxchg Double redos   %lu\nUnlocked Cmpxchg Double redos %lu\n",
 			s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail);
+	}
 }
 
 static void report(struct slabinfo *s)
#1 lore raw
Quoted 3 lines · Dan Carpenter

The curly braces are missing here so we print stuff unintentionally.

Fixes 9da4714a2d4f ('slub: slabinfo update for cmpxchg handling')

Hello,

a minor correction:
it's 9da4714a2d44

not 9da4714a2d4f

	-ss
Quoted 20 lines
tools/vm/slabinfo.c +2 -1
index 7cf6e17..b9d34b3 100644
@@ -510,10 +510,11 @@ static void slab_stats(struct slabinfo *s)
 			s->alloc_node_mismatch, (s->alloc_node_mismatch * 100) / total);
 	}
 
-	if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail)
+	if (s->cmpxchg_double_fail || s->cmpxchg_double_cpu_fail) {
 		printf("\nCmpxchg_double Looping\n------------------------\n");
 		printf("Locked Cmpxchg Double redos   %lu\nUnlocked Cmpxchg Double redos %lu\n",
 			s->cmpxchg_double_fail, s->cmpxchg_double_cpu_fail);
+	}
 }
 
 static void report(struct slabinfo *s)