Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp155150pxb; Tue, 9 Mar 2021 19:20:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzACJoHAwaW0mE8X84XlJgnPhm+lrCwXMQVZWxfA5UuoA3zvIoFDfmSI1f6PsKVzOy0lsR6 X-Received: by 2002:aa7:da48:: with SMTP id w8mr809162eds.81.1615346435235; Tue, 09 Mar 2021 19:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615346435; cv=none; d=google.com; s=arc-20160816; b=RtkQ+YWmP3Ss1afs+tEqnGwCDMmquZ3v2//tL0dN6AEgIO6JgajZ3+1gfzVs7miMlP 0+C6AQ+QmmmCP7wUI5LFcMj+QqYEgsqggWgr3K3rJNZljZGo013rC8tnaVKhps+LvQBS gVi+oLByMJdhW3ymi9XBy/61WLzgv/5SYet7kakxXeqM8JQzzsyfnX6uNWaECiWB2Kbk znWU4sR1uT1IGCVFquD6tcxfGS0H5K3t4+ZQk41Cby4u/oLux1Rbhl0AgRX9iF+PxBJQ zbqGGGGzBT/9OYU1r7B0k5F0xNffD8nvu6RZ3kBJuMwIyZk91RVPfOZFY1MRh0374QLV 0fyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=/QJLupaMMilOcufGb/jYn4YOF1QsQi6OHcOoQtnIIlk=; b=wC0PMrFgWj3F2x4IsukxR4xzS1K9ciROcJF8Kx0AESMSmy4Bjb9bto4rdfqOYWI2Vu wK2S7TCjXN4zxskUKig0CLvH/2j8pqpUvME++1NRWgq2wAr0um6p+gql8dXYjJXk1dZo 2jO92JrKE2+0ULanrIIIyG38arj3XKDIrl04l67zFBpzIW6gP/uGyICS+9NYyteIM0qd NGGoM1kx+up+364n++IApRKVFwdbCML+UU9VpNT5yYdiSS7RuKRiZw0CkhFcXrIP5L+R PFxRKjbBy9rirmKuUfkG+7Lz8Hlab1vWQcRLFrlz9omXALURge1/5TWAfcrKYbDWN1m6 F9Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si11247159edu.45.2021.03.09.19.20.12; Tue, 09 Mar 2021 19:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbhCJDTG (ORCPT + 99 others); Tue, 9 Mar 2021 22:19:06 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:54166 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbhCJDSm (ORCPT ); Tue, 9 Mar 2021 22:18:42 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0URBTR1u_1615346312; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0URBTR1u_1615346312) by smtp.aliyun-inc.com(127.0.0.1); Wed, 10 Mar 2021 11:18:38 +0800 From: Jiapeng Chong To: peterz@infradead.org Cc: mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Jiapeng Chong Subject: [PATCH] perf tools: Remove redundant code Date: Wed, 10 Mar 2021 11:18:25 +0800 Message-Id: <1615346305-16428-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warnings: ./tools/perf/util/evlist.c:1315:5-8: Unneeded variable: "err". Return "- ENOMEM" on line 1340. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- tools/perf/util/evlist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 882cd1f..6c2a271 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1313,7 +1313,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist) { struct perf_cpu_map *cpus; struct perf_thread_map *threads; - int err = -ENOMEM; /* * Try reading /sys/devices/system/cpu/online to get @@ -1338,7 +1337,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist) out_put: perf_cpu_map__put(cpus); out: - return err; + return -ENOMEM; } int evlist__open(struct evlist *evlist) -- 1.8.3.1