Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp598585pxb; Tue, 15 Feb 2022 23:19:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqEV+jE2KCfQX8OuuScIJCDYM61wIz1h1PUIbqO0aF8iAD27xp+8ibo8o6CBpiaGrFjaQX X-Received: by 2002:a17:90b:4f4b:b0:1ba:81fa:c6e3 with SMTP id pj11-20020a17090b4f4b00b001ba81fac6e3mr250655pjb.121.1644995966881; Tue, 15 Feb 2022 23:19:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995966; cv=none; d=google.com; s=arc-20160816; b=nvZxkEUVVLAM1nVJidIZgPiMwOwMb644D2+BGubyCkexaAZ/RN9jLKyVYM5k3oqY+A aiGwLzfXinIFlDM8GXlQQLVSkPJylCZMrD/eUUurs3g9vfoJzwInenP5EEkmSgZI2D5a 0+i8tOEIh19vC/PYtcGNKG2hxlzh7VHXiNiXin/QrqOsMvvREAOsz3F00XAO8/wEPEDr NIVT99eEjQaaoysrWodTue6zUf/gltD5diqUJuZSrOy9uqankiLL1k+DGACSCjvejHf1 rHUTHBDQPssGfj35rGb7JqUI0NfK643+ECnscC+wutZyo9UrHBlDfBbmJivlQa3CVGDR YKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=i+XpSzN5BpzSAmeKKZ80W7rv1bMxUtxZCdZ7efVp52o=; b=yvmxbFAv5+jnpTxno08O74eQV/5zV9+EbWOiBq2N35cfX1iiUdOeMIgk0SA3ezbdGU NBT+tDuKkXGXXBfXBnRrY8RsRVdn/mDtzNe2bodvKXCv1myBDz2K2PzHOLm43oq+grwc wZ68+ulmEZai9Yr8TtPqd/Ttm4qisQozzlc31DUn2/LwcNIXUc1cW1ZoqLnwTj3FXFA1 uvwMwnzWERqjRzcqQlpa2Qd2o1+mjJSdT/+5yep98gDnNk3311luNynNRblcXE0exwfR KLaahcUBbvLkgOVVE3r08/Qaor+uQO/ySX8ar0c2UiMxzX1ogxgm1Z/wQBlW4IaIuZxP Ltxw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u8si4042635plf.527.2022.02.15.23.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:19:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D8C62275ADE; Tue, 15 Feb 2022 22:50:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344031AbiBPDGA (ORCPT + 99 others); Tue, 15 Feb 2022 22:06:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344018AbiBPDF6 (ORCPT ); Tue, 15 Feb 2022 22:05:58 -0500 Received: from qq.com (smtpbg472.qq.com [59.36.132.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18505FDFA7 for ; Tue, 15 Feb 2022 19:05:46 -0800 (PST) X-QQ-mid: bizesmtp90t1644980693tylaq75g Received: from localhost.localdomain (unknown [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 16 Feb 2022 11:04:41 +0800 (CST) X-QQ-SSF: 01400000002000B0E000B00A0000000 X-QQ-FEAT: G+mSt178IQqtrmaXXYz7lyJ3KPDNlaIiWGgP5TqNWATsAk5FNjA6Hpx8ZL6bA ZxDb1yzWaOxKOFBHgb8MJGjuZXSvhgysm10z5X+aHlHK4bXs+sK08W2IBG1mN1GFPo60TTX PjFiyDgNr0Q54GGlU9Yp22YFB+z4TA81L4Wt6iav0ITlcyMRs+JYs2f3HunMvRvlXWr9tyD +mtDfFrtxD9UKdXq4mO2bOwmV4dlxUHJai+QqFppNKRC0S9zwY5uq4DPGq0qC/fwoExFE80 JIMmVM2DNz2ZzG+wq51B8QKitjs1ikMtp0KU5g/jn/JrOAsNQ8UuQbn+9sX1IBXmGtjd7R+ U6nIGiN1ncPIg/0kM25gNH1zpK8lg== X-QQ-GoodBg: 2 From: tangmeng To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, tangmeng Subject: [PATCH 2/2] perf tools: Remove redundant err variable Date: Wed, 16 Feb 2022 11:04:25 +0800 Message-Id: <20220216030425.27779-2-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220216030425.27779-1-tangmeng@uniontech.com> References: <20220216030425.27779-1-tangmeng@uniontech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 The variable err in the perf_event__process_sample is only used in the only one judgment statement, it is not used in other places. So, use the return value from hist_entry_iter__add() directly instead of taking this in another redundant variable. Signed-off-by: tangmeng --- tools/perf/builtin-top.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 1fc390f136dd..3c8c60b7f6f0 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -746,7 +746,6 @@ static void perf_event__process_sample(struct perf_tool *tool, { struct perf_top *top = container_of(tool, struct perf_top, tool); struct addr_location al; - int err; if (!machine && perf_guest) { static struct intlist *seen; @@ -839,8 +838,7 @@ static void perf_event__process_sample(struct perf_tool *tool, pthread_mutex_lock(&hists->lock); - err = hist_entry_iter__add(&iter, &al, top->max_stack, top); - if (err < 0) + if (hist_entry_iter__add(&iter, &al, top->max_stack, top) < 0) pr_err("Problem incrementing symbol period, skipping event\n"); pthread_mutex_unlock(&hists->lock); -- 2.20.1