Re: [PATCH] intel_th: msu: fix unused variables

From: Geert Uytterhoeven
Date: Wed May 08 2019 - 05:12:07 EST


On Tue, May 7, 2019 at 3:53 PM Anders Roxell <anders.roxell@xxxxxxxxxx> wrote:
> When building and CONFIG_X86 isn't set the compiler rightly complains
> about an unused varable 'i', see the warning below:
>
> ../drivers/hwtracing/intel_th/msu.c: In function âmsc_buffer_win_allocâ:
> ../drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable âiâ [-Wunused-variable]
> int ret = -ENOMEM, i;
> ^
> ../drivers/hwtracing/intel_th/msu.c: In function âmsc_buffer_win_freeâ:
> ../drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable âiâ [-Wunused-variable]
> int i;
> ^
>
> Rework so that an else part is added where empty functions are created
> for set_memory_uc() and set_memory_wb(), in that way we could remove
> '#ifdef CONFIG_X86' in function msc_buffer_win_alloc() and
> msc_buffer_win_free().
>
> Fixes: ba39bd830605 ("intel_th: msu: Switch over to scatterlist")
> Signed-off-by: Anders Roxell <anders.roxell@xxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/hwtracing/intel_th/msu.c
> +++ b/drivers/hwtracing/intel_th/msu.c
> @@ -21,6 +21,11 @@
>
> #ifdef CONFIG_X86
> #include <asm/set_memory.h>
> +#else
> +static void set_memory_uc(unsigned long addr, int numpages)

static inline?

> +{}
> +static void set_memory_wb(unsigned long addr, int numpages)

static inline?

> +{}
> #endif

Regardless:
Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds