From patchwork Wed Jul 4 15:51:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v5,01/19] kcmp: Cleanup sources From: Cyrill Gorcunov X-Patchwork-Id: 8807 Message-Id: <20180704155147.29114-2-gorcunov@gmail.com> To: crml Cc: Cyrill Gorcunov , Andrey Vagin Date: Wed, 4 Jul 2018 18:51:29 +0300 From: Cyrill Gorcunov - 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 --- 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 + #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 #include +#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;