Skip to contentSkip to conversation

fix include statement in stats.h

PATCH Applied Martin Peschke 2 participants 2 messages Apr 20, 2009 – Apr 21, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix include statement in stats.h

From: Martin Peschke <[email protected]>

Some endianess conversion macros have been moved and the corresponding header file is gone. Need to adapt an include statement in stats.h. The compiler did not complain because blkiomon.c accidently included blktrace.h prior to stats.h. Introduced by blktrace rewrite which became version 2.

---
 stats.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stats.h +1 -1
@@ -23,7 +23,7 @@
 #define STATS_H
 
 #include <linux/types.h>
-#include "endian.h"
+#include "blktrace.h"
 
 struct minmax {
 	__u64 min;
Applied
#1 lore raw

Applied both, thanks Martin!

Quoted 26 lines · Martin Peschke

From: Martin Peschke <[email protected]>

Some endianess conversion macros have been moved and the corresponding header file is gone. Need to adapt an include statement in stats.h. The compiler did not complain because blkiomon.c accidently included blktrace.h prior to stats.h. Introduced by blktrace rewrite which became version 2.

---
 stats.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stats.h +1 -1
@@ -23,7 +23,7 @@
 #define STATS_H
 
 #include <linux/types.h>
-#include "endian.h"
+#include "blktrace.h"
 
 struct minmax {
 	__u64 min;
Quoted 33 lines · Martin Peschke

From: Martin Peschke <[email protected]>

Fix two off-by-one issues. Last bucket of histogram was ommitted by mistake when being converted to big-endian or when being merged with another bucket.

---
 stats.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
stats.h +2 -2
@@ -124,7 +124,7 @@ static inline void histlog2_merge(struct
 {
 	int i;
 
-	for (i = 0; i < h->num - 1; i++)
+	for (i = 0; i < h->num; i++)
 		dst[i] += src[i];
 }
 
@@ -132,7 +132,7 @@ static inline void histlog2_to_be(__u32 
 {
 	int i;
 
-	for (i = 0; i < h->num - 1; i++)
+	for (i = 0; i < h->num; i++)
 		a[i] = cpu_to_be32(a[i]);
 }
 
Signature · 1 line
Jens Axboe