lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 28 Mar 2019 18:42:47 +0000
From:   Paul Burton <paul.burton@...s.com>
To:     Florian Fainelli <f.fainelli@...il.com>
CC:     "linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>,
        "open list:PERFORMANCE EVENTS SUBSYSTEM" 
        <linux-kernel@...r.kernel.org>,
        "open list:MIPS" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH fixes] MIPS: perf: Fix build with CONFIG_CPU_BMIPS5000
 enabled

Hi Florian,

On Tue, Mar 26, 2019 at 10:03:34AM -0700, Florian Fainelli wrote:
> The 'event' variable may be unused in case only CONFIG_CPU_BMIPS5000
> being enabled:
> 
> arch/mips/kernel/perf_event_mipsxx.c: In function 'mipsxx_pmu_enable_event':
> arch/mips/kernel/perf_event_mipsxx.c:326:21: error: unused variable 'event' [-Werror=unused-variable]
>   struct perf_event *event = container_of(evt, struct perf_event, hw);
>                      ^~~~~

Ah - nice catch :)

Could we fix it by replacing the existing #ifdef with an

  if (IS_ENABLED(CONFIG_CPU_BMIPS5000)) {

instead? The same could be done for the CONFIG_MIPS_MT_SMP #ifdefs too.

I think that would leave us with more readable code.

Thanks,
    Paul

> Fixes: 84002c88599d ("MIPS: perf: Fix perf with MT counting other threads")
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>  arch/mips/kernel/perf_event_mipsxx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
> index 413863508f6f..739b7ff9fdab 100644
> --- a/arch/mips/kernel/perf_event_mipsxx.c
> +++ b/arch/mips/kernel/perf_event_mipsxx.c
> @@ -323,7 +323,9 @@ static int mipsxx_pmu_alloc_counter(struct cpu_hw_events *cpuc,
>  
>  static void mipsxx_pmu_enable_event(struct hw_perf_event *evt, int idx)
>  {
> +#ifndef CONFIG_CPU_BMIPS5000
>  	struct perf_event *event = container_of(evt, struct perf_event, hw);
> +#endif
>  	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
>  #ifdef CONFIG_MIPS_MT_SMP
>  	unsigned int range = evt->event_base >> 24;
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ