[PATCH] lib: fwts_virt: fix non-Intel build errors

Keng-Yu Lin kengyu at canonical.com
Mon Dec 10 07:14:01 UTC 2012


On Fri, Dec 7, 2012 at 6:09 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> This fixes a -Wextra build error for non-Intel builds.  This function
> is only used in x86 tests so we can just make this function return dummy
> values anyway since it is never called on non-x86 systems.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_virt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/lib/src/fwts_virt.c b/src/lib/src/fwts_virt.c
> index ad5bec0..3c3831b 100644
> --- a/src/lib/src/fwts_virt.c
> +++ b/src/lib/src/fwts_virt.c
> @@ -58,6 +58,14 @@ void fwts_exec_cpuid(const int cpu, const uint32_t cmd, cpu_registers* regs)
>                               "=c"(regs->ecx),"=d"(regs->edx)
>                            : "a"(cmd)
>         );
> +#else
> +       /* Non x86 we just fake it */
> +       FWTS_UNUSED(cmd);
> +
> +       regs->eax = 0;
> +       regs->ebx = 0;
> +       regs->ecx = 0;
> +       regs->edx = 0;
>  #endif
>
>         if (cpu != CURRENT_CPU)
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list