[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v3 4/4] cpumask: tidy {,z}alloc_cpumask_var()
Drop unnecessary casts and use bool in favor of bool_t. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -345,9 +345,9 @@ static inline int cpulist_scnprintf(char typedef cpumask_t *cpumask_var_t; -static inline bool_t alloc_cpumask_var(cpumask_var_t *mask) +static inline bool alloc_cpumask_var(cpumask_var_t *mask) { - *(void **)mask = _xmalloc(nr_cpumask_bits / 8, sizeof(long)); + *mask = _xmalloc(nr_cpumask_bits / 8, sizeof(long)); return *mask != NULL; } @@ -358,9 +358,9 @@ static inline bool cond_alloc_cpumask_va return *mask != NULL; } -static inline bool_t zalloc_cpumask_var(cpumask_var_t *mask) +static inline bool zalloc_cpumask_var(cpumask_var_t *mask) { - *(void **)mask = _xzalloc(nr_cpumask_bits / 8, sizeof(long)); + *mask = _xzalloc(nr_cpumask_bits / 8, sizeof(long)); return *mask != NULL; } @@ -383,16 +383,16 @@ static inline void free_cpumask_var(cpum #else typedef cpumask_t cpumask_var_t[1]; -static inline bool_t alloc_cpumask_var(cpumask_var_t *mask) +static inline bool alloc_cpumask_var(cpumask_var_t *mask) { - return 1; + return true; } #define cond_alloc_cpumask_var alloc_cpumask_var -static inline bool_t zalloc_cpumask_var(cpumask_var_t *mask) +static inline bool zalloc_cpumask_var(cpumask_var_t *mask) { cpumask_clear(*mask); - return 1; + return true; } #define cond_zalloc_cpumask_var zalloc_cpumask_var _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |