Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp576208pxb; Tue, 15 Feb 2022 22:37:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3yxz/Hy229uYT7ggQH//ZhJ9ZUqNkko1nRzsNSAkNUXCrwAFxHMfM6RqI3yysY20Bncfz X-Received: by 2002:a17:902:70c8:b0:14f:2d92:baaa with SMTP id l8-20020a17090270c800b0014f2d92baaamr1452606plt.162.1644993421702; Tue, 15 Feb 2022 22:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644993421; cv=none; d=google.com; s=arc-20160816; b=YnBS9TkkWTDVMH2WTdIy8+opbHF4JG3s7u4SeeCytr+uZO3RWTs9lIMkaKq9lJkOWb SzcZOsxvzt+HR6o0Nbm2+VVM6ce+2y24fT2CGZzyCmv7jf9jc4GBUXFpCIpZS+9Tu6dZ yRGIl6Q+RFpcsU93tvlCZ1h+T3wfh5AmXjaICQKfBlJUIFPqaGV48JvZs/zvaXJmBfFb KyY4ycUsfaoW/+/+dDbxpc1qEQZC2uziCME/WGFh6+47rTcZXHizsYFYBMXCbDaG6Y07 DQKYzq2uR65GsqDAeTH4xEgVg7eJJw/nftQ9qz9ALhfp5JepQeC4y2RkqcF9jDaA+Jmf 3+5g== 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:message-id:date:subject:cc:to:from; bh=B3JcykDtW+48V1NTzUjxRSoFyrdF0XKv9IooCUCf2HI=; b=Eni/wLFuToCbBD0x4nN2x454tyaUmvxkTpYXWRbu9rjZzHTviuw9XhPU2UWL8n/x5O JozSY8nxJZ/pqQ5du535Y9I3mmS4mfzynWH7i4IaHChcj2HWje0UEVRpun7DBGv3zztz IMHjL8xgUtxkREI50dl59J4pr4cNRgXarFf1KZeizzYTHntn0bxCeROjFEpgGQyyTqbn riKUg5NNoHOSU7JLjFnRuy3GgL/uzpjTIX842OeRzmmUSiM9aRpCu3H3KK/LNRK7f04Y f6MZ7VHlFkpgmPKHhUPtqUKU0vCmf3+C5xbPCEWHJtCSuTx/MHnlRF535D/ERcGe1uRs tMfQ== 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 b9si16679404pls.230.2022.02.15.22.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:37:01 -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 ADAD32D1EE; Tue, 15 Feb 2022 22:27:27 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344020AbiBPDF5 (ORCPT + 99 others); Tue, 15 Feb 2022 22:05:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344018AbiBPDFz (ORCPT ); Tue, 15 Feb 2022 22:05:55 -0500 Received: from qq.com (smtpbg458.qq.com [59.36.132.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DDB4FDFA7 for ; Tue, 15 Feb 2022 19:05:42 -0800 (PST) X-QQ-mid: bizesmtp90t1644980678tkckuw3h Received: from localhost.localdomain (unknown [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 16 Feb 2022 11:04:27 +0800 (CST) X-QQ-SSF: 01400000002000B0E000B00A0000000 X-QQ-FEAT: xoS364mEyr1yw2RUzBdRqiWRxqiQzTQwtwPSWDCxpOZsgPRJXULOaLK+heC5o lu2prAox1PgQNJyJly3Z5jeOJ0dA8IXWpCoJZbwJeETdxf93tF0MZy4h3btVuOFM6wP/GPb FsRC03JOg7+3z+7yCBc7rHl4dhhcascxVXLYXrpT1ya69jpaD/0dLZt3hKSe74FbWyPI/aS XYeaM/fe5nZp/HXmlQoMrbXt2b6fN0In85A/v4HK5rLcJauqa7Z7AgS+pk/2atJ7F//d0QZ zW8WvqaGnqrSDQNyjlQHMA7naipoMbCMlafB00Qz4c5gbfpPOyzeGK2Sqp8AU7fjRo1PS6k bArr0RmHMGZVWJ35/JyhxGWBHo9zA== 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 1/2] perf tools: Remove redundant ret variable Date: Wed, 16 Feb 2022 11:04:24 +0800 Message-Id: <20220216030425.27779-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign5 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 Return value from hist_entry_iter__add() directly instead of taking this in another redundant variable. Signed-off-by: tangmeng --- tools/perf/builtin-annotate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 490bb9b8cf17..e347b8ef088f 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -190,7 +190,6 @@ static int process_branch_callback(struct evsel *evsel, }; struct addr_location a; - int ret; if (machine__resolve(machine, &a, sample) < 0) return -1; @@ -203,8 +202,7 @@ static int process_branch_callback(struct evsel *evsel, hist__account_cycles(sample->branch_stack, al, sample, false, NULL); - ret = hist_entry_iter__add(&iter, &a, PERF_MAX_STACK_DEPTH, ann); - return ret; + return hist_entry_iter__add(&iter, &a, PERF_MAX_STACK_DEPTH, ann); } static bool has_annotation(struct perf_annotate *ann) -- 2.20.1