[CRIU] [PATCH 1/9] kcmp: Cleanup sources

Cyrill Gorcunov gorcunov at gmail.com
Wed Jun 20 15:01:35 MSK 2018


From: Cyrill Gorcunov <gorcunov at openvz.org>

 - switch to use uintX type (just to drop uX finally,
   it doesn't worth to carry this type)

 - instead of including huge util.h rather include the
   files which are really needed: log, xmalloc, compiler
   and bug

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/include/kcmp-ids.h |  6 ++++--
 criu/kcmp-ids.c         | 13 +++++++++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/criu/include/kcmp-ids.h b/criu/include/kcmp-ids.h
index afe68d6d3285..ac6d84a2bb6a 100644
--- a/criu/include/kcmp-ids.h
+++ b/criu/include/kcmp-ids.h
@@ -1,6 +1,8 @@
 #ifndef __CR_KCMP_IDS_H__
 #define __CR_KCMP_IDS_H__
 
+#include <stdint.h>
+
 #include "kcmp.h"
 
 struct kid_tree {
@@ -23,7 +25,7 @@ struct kid_elem {
 	unsigned idx;
 };
 
-extern u32 kid_generate_gen(struct kid_tree *tree,
-			    struct kid_elem *elem, int *new_id);
+extern uint32_t kid_generate_gen(struct kid_tree *tree,
+				 struct kid_elem *elem, int *new_id);
 
 #endif /* __CR_KCMP_IDS_H__ */
diff --git a/criu/kcmp-ids.c b/criu/kcmp-ids.c
index 2a76853974d8..c87e245d0308 100644
--- a/criu/kcmp-ids.c
+++ b/criu/kcmp-ids.c
@@ -2,8 +2,13 @@
 #include <stdlib.h>
 #include <sys/syscall.h>
 
+#include "log.h"
+#include "xmalloc.h"
+
+#include "common/compiler.h"
+#include "common/bug.h"
+
 #include "rbtree.h"
-#include "util.h"
 #include "kcmp-ids.h"
 
 /*
@@ -52,7 +57,7 @@ struct kid_entry {
 	struct rb_root	subtree_root;
 	struct rb_node	subtree_node;
 
-	u32		subid;	/* subid is always unique */
+	uint32_t	subid;	/* subid is always unique */
 	struct kid_elem	elem;
 } __aligned(sizeof(long));
 
@@ -79,7 +84,7 @@ static struct kid_entry *alloc_kid_entry(struct kid_tree *tree, struct kid_elem
 	return e;
 }
 
-static u32 kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
+static uint32_t kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
 		struct kid_elem *elem, int *new_id)
 {
 	struct rb_node *node = e->subtree_root.rb_node;
@@ -119,7 +124,7 @@ static u32 kid_generate_sub(struct kid_tree *tree, struct kid_entry *e,
 	return sub->subid;
 }
 
-u32 kid_generate_gen(struct kid_tree *tree,
+uint32_t kid_generate_gen(struct kid_tree *tree,
 		struct kid_elem *elem, int *new_id)
 {
 	struct rb_node *node = tree->root.rb_node;
-- 
2.14.4



More information about the CRIU mailing list