[PATCH] events: core: Remove unnecessary ‘0’ values from ret

From: Li kunyu
Date: Tue Aug 01 2023 - 21:37:09 EST


ret is assigned first, so it does not need to initialize the assignment.

Signed-off-by: Li kunyu <kunyu@xxxxxxxxxxxx>
---
kernel/events/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index db016e418931..97e69a558774 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -924,7 +924,7 @@ static inline int perf_cgroup_connect(int fd, struct perf_event *event,
struct perf_cgroup *cgrp;
struct cgroup_subsys_state *css;
struct fd f = fdget(fd);
- int ret = 0;
+ int ret;

if (!f.file)
return -EBADF;
@@ -6371,7 +6371,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
unsigned long vma_size;
unsigned long nr_pages;
long user_extra = 0, extra = 0;
- int ret = 0, flags = 0;
+ int ret, flags = 0;

/*
* Don't allow mmap() of inherited per-task counters. This would
--
2.18.2