mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-02 17:34:27 +00:00
dm: clean up mem.c
- use strncmp() instead of comparing string pointers to make no assumptions about the toolchain's literal pool - re-shuffle the functions so they're consistent with mem.h - make non-public functions static - increase code re-use Tracked-On: #2792 Signed-off-by: Peter Fang <peter.fang@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
@@ -385,7 +385,7 @@ struct { \
|
||||
#define RB_PROTOTYPE(name, type, field, cmp) \
|
||||
RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
|
||||
#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
|
||||
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
|
||||
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, static)
|
||||
#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
|
||||
RB_PROTOTYPE_INSERT_COLOR(name, type, attr); \
|
||||
RB_PROTOTYPE_REMOVE_COLOR(name, type, attr); \
|
||||
@@ -422,7 +422,7 @@ struct { \
|
||||
#define RB_GENERATE(name, type, field, cmp) \
|
||||
RB_GENERATE_INTERNAL(name, type, field, cmp,)
|
||||
#define RB_GENERATE_STATIC(name, type, field, cmp) \
|
||||
RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
|
||||
RB_GENERATE_INTERNAL(name, type, field, cmp, __attribute__((unused)) static)
|
||||
#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
|
||||
RB_GENERATE_INSERT_COLOR(name, type, field, attr) \
|
||||
RB_GENERATE_REMOVE_COLOR(name, type, field, attr) \
|
||||
|
Reference in New Issue
Block a user