[PATCH 6/7] powerpc/perf: Fix W=1 compile warning

Christophe Leroy christophe.leroy at csgroup.eu
Fri Sep 11 15:42:03 AEST 2020



Le 10/09/2020 à 23:02, Cédric Le Goater a écrit :
> CC      arch/powerpc/perf/imc-pmu.o
> ../arch/powerpc/perf/imc-pmu.c: In function ‘trace_imc_event_init’:
> ../arch/powerpc/perf/imc-pmu.c:1429:22: error: variable ‘target’ set but not used [-Werror=unused-but-set-variable]
>    struct task_struct *target;
>                        ^~~~~~

A small sentence explaining how this is fixed would be welcome, so that 
you don't need to read the code the know what the commit does to fix the 
warning. Also the subject should be more explicit.

> 
> Cc: Anju T Sudhakar <anju at linux.vnet.ibm.com>
> Signed-off-by: Cédric Le Goater <clg at kaod.org>

Reviewed-by: Christophe Leroy <christophe.leroy at csgroup.eu>

> ---
>   arch/powerpc/perf/imc-pmu.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
> index 62d0b54086f8..9ed4fcccf8a9 100644
> --- a/arch/powerpc/perf/imc-pmu.c
> +++ b/arch/powerpc/perf/imc-pmu.c
> @@ -1426,8 +1426,6 @@ static void trace_imc_event_del(struct perf_event *event, int flags)
>   
>   static int trace_imc_event_init(struct perf_event *event)
>   {
> -	struct task_struct *target;
> -
>   	if (event->attr.type != event->pmu->type)
>   		return -ENOENT;
>   
> @@ -1458,7 +1456,6 @@ static int trace_imc_event_init(struct perf_event *event)
>   	mutex_unlock(&imc_global_refc.lock);
>   
>   	event->hw.idx = -1;
> -	target = event->hw.target;
>   
>   	event->pmu->task_ctx_nr = perf_hw_context;
>   	event->destroy = reset_global_refc;
> 


More information about the Linuxppc-dev mailing list