mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
hv: treewide: fix 'Use of function like macro'
- convert function like macros to inline functions based on MISRA-C requirement - remove some unused and duplicated macros Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -391,8 +391,8 @@ void *memcpy_s(void *d, size_t dmax, const void *s, size_t slen_arg)
|
||||
}
|
||||
|
||||
/* make sure 8bytes-aligned for at least one addr. */
|
||||
if ((!MEM_ALIGNED_CHECK(src8, 8UL)) &&
|
||||
(!MEM_ALIGNED_CHECK(dest8, 8UL))) {
|
||||
if ((!mem_aligned_check((uint64_t)src8, 8UL)) &&
|
||||
(!mem_aligned_check((uint64_t)dest8, 8UL))) {
|
||||
for (; (slen != 0U) && ((((uint64_t)src8) & 7UL) != 0UL);
|
||||
slen--) {
|
||||
*dest8 = *src8;
|
||||
|
@@ -9,7 +9,10 @@
|
||||
#define LONG_MAX (ULONG_MAX >> 1U) /* 0x7FFFFFFF */
|
||||
#define LONG_MIN (~LONG_MAX) /* 0x80000000 */
|
||||
|
||||
#define ISSPACE(c) ((c == ' ') || (c == '\t'))
|
||||
static inline bool is_space(char c)
|
||||
{
|
||||
return ((c == ' ') || (c == '\t'));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a string to a long integer - decimal support only.
|
||||
@@ -28,7 +31,7 @@ long strtol_deci(const char *nptr)
|
||||
do {
|
||||
c = *s;
|
||||
s++;
|
||||
} while (ISSPACE(c));
|
||||
} while (is_space(c));
|
||||
|
||||
if (c == '-') {
|
||||
neg = 1;
|
||||
@@ -107,7 +110,7 @@ uint64_t strtoul_hex(const char *nptr)
|
||||
do {
|
||||
c = *s;
|
||||
s++;
|
||||
} while (ISSPACE(c));
|
||||
} while (is_space(c));
|
||||
|
||||
if ((c == '0') && ((*s == 'x') || (*s == 'X'))) {
|
||||
c = s[1];
|
||||
|
Reference in New Issue
Block a user