linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] events: core: Remove unnecessary ‘0’ values from ret
@ 2023-08-02  1:36 Li kunyu
  0 siblings, 0 replies; only message in thread
From: Li kunyu @ 2023-08-02  1:36 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter
  Cc: linux-perf-users, linux-kernel, Li kunyu

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(-)

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-02  1:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02  1:36 [PATCH] events: core: Remove unnecessary ‘0’ values from ret Li kunyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).