On Tue, Jan 19, 2016 at 01:46:05PM -0800, Sinclair Yeh wrote:
> Updated VMWARE_BALLOON_CMD to use the common VMW_PORT macro.
> Doing this rather than replacing all instances of VMWARE_BALLOON_CMD
> to minimize code change.
> 
> Signed-off-by: Sinclair Yeh <s...@vmware.com>
> Reviewed-by: Thomas Hellstrom <thellst...@vmware.com>
> Reviewed-by: Alok N Kataria <akata...@vmware.com>
> Acked-by: Xavier Deguillard <xdeguill...@vmware.com>
> Cc: pv-driv...@vmware.com
> Cc: Xavier Deguillard <xdeguill...@vmware.com>
> Cc: linux-ker...@vger.kernel.org
> Cc: virtualization@lists.linux-foundation.org
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>


Acked-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

> -#define VMWARE_BALLOON_CMD(cmd, arg1, arg2, result)          \
> -({                                                           \
> -     unsigned long __status, __dummy1, __dummy2, __dummy3;   \
> -     __asm__ __volatile__ ("inl %%dx" :                      \
> -             "=a"(__status),                                 \
> -             "=c"(__dummy1),                                 \
> -             "=d"(__dummy2),                                 \
> -             "=b"(result),                                   \
> -             "=S" (__dummy3) :                               \
> -             "0"(VMW_BALLOON_HV_MAGIC),                      \
> -             "1"(VMW_BALLOON_CMD_##cmd),                     \
> -             "2"(VMW_BALLOON_HV_PORT),                       \
> -             "3"(arg1),                                      \
> -             "4" (arg2) :                                    \
> -             "memory");                                      \
> -     if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START)     \
> -             result = __dummy1;                              \
> -     result &= -1UL;                                         \
> -     __status & -1UL;                                        \
> +#define VMWARE_BALLOON_CMD(cmd, arg1, arg2, result)                  \
> +({                                                                   \
> +     unsigned long __status, __dummy1, __dummy2;                     \
> +     unsigned long __si, __di;                                       \
> +     VMW_PORT(VMW_BALLOON_CMD_##cmd, arg1, arg2, 0,                  \
> +              VMW_BALLOON_HV_PORT, VMW_BALLOON_HV_MAGIC,             \
> +              __status, result, __dummy1, __dummy2, __si, __di);     \
> +     if (VMW_BALLOON_CMD_##cmd == VMW_BALLOON_CMD_START)             \
> +             result = __dummy1;                                      \
> +     result &= -1UL;                                                 \
> +     __status & -1UL;                                                \
>  })

Honestly, it doesn't look anymore "readable" to me, but it's your code
to maintain, not mine... :)

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to