lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] riscv: perf_event: Remove redundant initialization of variable ret
Date
The variable ret is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed. Clean up the incorrectly indented following
declaration of variable code and move to the same line as the
declaration of variable ret.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
arch/riscv/kernel/perf_event.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/perf_event.c b/arch/riscv/kernel/perf_event.c
index c835f0362d94..cf3e2ac9bbb2 100644
--- a/arch/riscv/kernel/perf_event.c
+++ b/arch/riscv/kernel/perf_event.c
@@ -156,8 +156,7 @@ static int riscv_map_cache_decode(u64 config, unsigned int *type,
static int riscv_map_cache_event(u64 config)
{
unsigned int type, op, result;
- int err = -ENOENT;
- int code;
+ int err, code;

err = riscv_map_cache_decode(config, &type, &op, &result);
if (!riscv_pmu->cache_events || err)
--
2.33.1
\
 
 \ /
  Last update: 2021-11-26 23:34    [W:0.756 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site