cpu-set-util: internally merge two functions

This commit is contained in:
Yu Watanabe
2017-12-06 10:32:32 +09:00
parent b57b372a05
commit 6d8a29b2e1
2 changed files with 27 additions and 59 deletions
+11 -2
View File
@@ -30,5 +30,14 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(cpu_set_t*, CPU_FREE);
cpu_set_t* cpu_set_malloc(unsigned *ncpus);
int parse_cpu_set_and_warn(const char *rvalue, cpu_set_t **cpu_set, const char *unit, const char *filename, unsigned line, const char *lvalue);
int parse_cpu_set(const char *rvalue, cpu_set_t **cpu_set);
int parse_cpu_set_internal(const char *rvalue, cpu_set_t **cpu_set, bool warn, const char *unit, const char *filename, unsigned line, const char *lvalue);
static inline int parse_cpu_set_and_warn(const char *rvalue, cpu_set_t **cpu_set, const char *unit, const char *filename, unsigned line, const char *lvalue) {
assert(lvalue);
return parse_cpu_set_internal(rvalue, cpu_set, true, unit, filename, line, lvalue);
}
static inline int parse_cpu_set(const char *rvalue, cpu_set_t **cpu_set){
return parse_cpu_set_internal(rvalue, cpu_set, false, NULL, NULL, 0, NULL);
}