From patchwork Wed Aug 2 01:36:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 129559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp152057vqx; Tue, 1 Aug 2023 19:21:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGq7nFFV4Jqj8Ckc7Yug1/2G5exYiNt6KGHMav3jxS8D4SfCd7gZ/HaejhODpvp3RuMCtIf X-Received: by 2002:a05:6808:15a2:b0:3a7:4ce4:cb8f with SMTP id t34-20020a05680815a200b003a74ce4cb8fmr4367782oiw.8.1690942884454; Tue, 01 Aug 2023 19:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690942884; cv=none; d=google.com; s=arc-20160816; b=NIQ0OuyFf9ADuVbpha+dAsYka0SyfN9zHHph/XjKItRVxwZqaHVdVciFo+i29e0W8v 28rFprLctlJRgTTsBepTgkYEn3E1MdkiOScglYD8Yx4PuayPBY2VJ8xty/VEXF7dOJYE zoysz96Ep4HAAk5neuq3ee/Lmt3r6GrDiG4NTxN4+yO58UVDfFYAvFvsDSvQa6e2Sh5z sPCt09TGIb7wiItzqxCgtsBq73l8/sw/d/lLRJ2HY2LB/RT4fSgy5v8ZqDETpW7alxH4 H8MRJPxe6XxoegvjfoHMApAauuRK5aMsC09FUk4uLxCHoNfAuXaJr/Xkwy6jdBzX7l52 tjCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qssiHpdg4F7H//LKRqR3OUX6zBdeEAeQObU16ivsObo=; fh=tRvkKx95xbDjFLhXl+7gO0ohQ764z6j4Wrph8eduWXs=; b=X0/BHejA67EE6+EW7qRIDBLoTqiz6yzClwEJMP1WznSwSUYUb1I5T9iRAkoGQVtj/q lFthJW172enIiFF3gPVupAr5Sbm6An6relvUEMVldK8bjVGFFWe4jfEdcUp6ko6AJ4+U F1oUJ/swOuTus1dHl8a7cCtL4wdOU1OvQFfELv8jAHBIVzAD3VBS6Mse7AXBmKx6YzyH VAlQlW/fhIxht3fzk7RJ+wHJmIXLibBsH/cpFG8vr99YJwBOLrYG+LQt6w2d4vp4yoxZ 6MZ68ToruLNSvgSP70t9mJ4kDXbyP6dFgshB0jU/ESJZUGi7mj0KxuD1kHiAMuqfgAMu BC4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u27-20020a056a00099b00b0067537349056si10492647pfg.342.2023.08.01.19.21.11; Tue, 01 Aug 2023 19:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbjHBBhG (ORCPT + 99 others); Tue, 1 Aug 2023 21:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjHBBhE (ORCPT ); Tue, 1 Aug 2023 21:37:04 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0BFBF1B7; Tue, 1 Aug 2023 18:37:02 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0BF516026E582; Wed, 2 Aug 2023 09:36:51 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?events=3A_core=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Wed, 2 Aug 2023 09:36:30 +0800 Message-Id: <20230802013630.7589-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773082126075404220 X-GMAIL-MSGID: 1773082126075404220 ret is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li kunyu --- 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