From patchwork Tue Aug 15 22:10:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 135710 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:3f2:4152:657d with SMTP id x8csp821030vqo; Tue, 15 Aug 2023 19:16:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGe+iGLdto7wSHuXmL0Dq8uPuJ1kQwywb12gfVNJGMXIhtZ7Ps2cGezekadhwTVWwBMXGWD X-Received: by 2002:a05:6a21:6da5:b0:144:c131:dbe2 with SMTP id wl37-20020a056a216da500b00144c131dbe2mr1018834pzb.5.1692152170958; Tue, 15 Aug 2023 19:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692152170; cv=none; d=google.com; s=arc-20160816; b=CqVqtyJLlxxOibmsq+NNwTkjM0NaikHqL0MHrO2QUFSeMixf9G3cCrmMq96T9mORn8 qhNW5T4Ej3vzFlyAvbuiJUwqgobqp+SaJArYNJ1vdZoolhfPsvFvRYVUxSF65WM+/RVY KjF4kyM8m1far+KymqOZHCqpmVNzchVS3ak8ygUr18BmXd3XwagR007rW5DULW7IHpLS dKKPx++6abeIHoq7Zuij+nLMiA7muZB8Pw6PhzZoq+b57qRmrdk3Vh3MtqxFHNrxbBBE GBd/uy7yk5WQagfq7mq8GlGw0PFNsh3RMZMQzXXogqwvPhVN+PxYvzGVVo+956jZshM4 IpEg== 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=HzyHTEPQcT4jRHqx4IgCqabQGrMDCcZ1lBHZkl3/eFY=; fh=gUa2bp80+YzpHmwfu8EgysVxNTTSPOOMuLFm8Njf9YM=; b=ojySjYy1spOjgfRuA0m1Cj/lAL4uiJNkUJ/su+QFSxg/2rxrjPQ09PiHlXO1yAHPDh o1djiIUIcPKwg2E9snM9R0xFu41g8hn3ieQPvip5FCjYcllF7cjKhXt/HF/4xWTv0rOR LJG8yLCTBgPB9s9+N+ndNz01J/E5mlKUAhhYiqCr/yFgDLDPDduJAIx/cuoFrRJMpVoD kteKBnSRhHaEzw/n77uz7Yk95kIWrHbj0h0SAGvdkdenliU2XjF59WZOSa6LUuMoScim J2BBT9DtnhRBIbb/EWg7Zbg4OLmv/8ZejW5kyATc24QGxetxoEESc5KRC5ASSSI2eMfr A7/Q== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l69-20020a633e48000000b0055391572218si1031761pga.26.2023.08.15.19.15.55; Tue, 15 Aug 2023 19:16:10 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237493AbjHOOGc (ORCPT + 99 others); Tue, 15 Aug 2023 10:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237505AbjHOOGS (ORCPT ); Tue, 15 Aug 2023 10:06:18 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 138C2199A; Tue, 15 Aug 2023 07:06:17 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RQCh71Z3Mz1GDMB; Tue, 15 Aug 2023 22:04:55 +0800 (CST) Received: from ultra.huawei.com (10.90.53.71) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 15 Aug 2023 22:06:13 +0800 From: Yang Jihong To: , , , , , , , , , , , , , CC: Subject: [PATCH] perf evsel: Remove duplicate check for `field` in evsel__intval() Date: Tue, 15 Aug 2023 22:10:09 +0000 Message-ID: <20230815221009.3641751-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Originating-IP: [10.90.53.71] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: 1774350154427364361 X-GMAIL-MSGID: 1774350154427364361 The `file` parameter in evsel__intval() is checked repeatedly, fix it. No functional change. Signed-off-by: Yang Jihong --- tools/perf/util/evsel.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e41bc4d9925f..0c50c443d456 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2827,9 +2827,6 @@ u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *n { struct tep_format_field *field = evsel__field(evsel, name); - if (!field) - return 0; - return field ? format_field__intval(field, sample, evsel->needs_swap) : 0; } #endif