events: core: Remove unnecessary ‘0’ values from ret

Message ID 20230802013630.7589-1-kunyu@nfschina.com
State New
Headers
Series events: core: Remove unnecessary ‘0’ values from ret |

Commit Message

Li kunyu Aug. 2, 2023, 1:36 a.m. UTC
  ret is assigned first, so it does not need to initialize the assignment.

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

Patch

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