hv: drop the macro arguments acting as formal parameter names

This patch fixes the following issue pointed by Xiangyang and Junjie.
There are some macro arguments acting as formal parameter names.
Drop such arguments since they make no difference to the expanded
implementation and they might confuse some developers.

Here is an example.
'ptr' is dropped in this patch, which is acting as a formal parameter
name and make no difference to the expanded implementation.

-#define build_atomic_load(name, size, type, ptr)       \
+#define build_atomic_load(name, size, type)            \
 static inline type name(const volatile type *ptr)      \
{                                                       \
        type ret;                                       \
        asm volatile("mov" size " %1,%0"                \
                        : "=r" (ret)                    \
                        : "m" (*ptr)                    \
                        : "cc", "memory");              \
        return ret;                                     \
}

Some minor coding style fixes are also included in this patch.
- use TAB for the alignment rather than mixing TAB with space
- fix some typo in the comments

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2018-09-27 09:56:35 +08:00
committed by lijinxia
parent 74622d7d29
commit 05ad6d6628
3 changed files with 73 additions and 77 deletions

View File

@@ -633,19 +633,19 @@ static void vie_update_rflags(struct vcpu *vcpu, uint64_t rflags2, uint64_t psl)
/*
* Return the status flags that would result from doing (x - y).
*/
#define build_getcc(name, type, x, y) \
static uint64_t name(type x, type y) \
{ \
uint64_t rflags; \
\
#define build_getcc(name, type) \
static uint64_t name(type x, type y) \
{ \
uint64_t rflags; \
\
__asm __volatile("sub %2,%1; pushfq; popq %0" : \
"=r" (rflags), "+r" (x) : "m" (y)); \
return rflags; \
}
build_getcc(getcc8, uint8_t, x, y)
build_getcc(getcc16, uint16_t, x, y)
build_getcc(getcc32, uint32_t, x, y)
build_getcc(getcc64, uint64_t, x, y)
build_getcc(getcc8, uint8_t)
build_getcc(getcc16, uint16_t)
build_getcc(getcc32, uint32_t)
build_getcc(getcc64, uint64_t)
/**
* @pre opsize = 1, 2, 4 or 8