Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1111342rdb; Wed, 16 Aug 2023 01:53:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9V6/0u+o4V1bBp1aJLU0uXfm5NiFsevyZWNKnJW65rfYHdoa3Ct2NHnOcFXrQCEWZ0MUC X-Received: by 2002:a17:902:f805:b0:1bd:a26a:58cd with SMTP id ix5-20020a170902f80500b001bda26a58cdmr1385204plb.15.1692176004179; Wed, 16 Aug 2023 01:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692176004; cv=none; d=google.com; s=arc-20160816; b=AKRqNXGbLBrwO0P5iybMaYzwZOy2gqcadkkb4dBE3WyJ2/N46AJhx05Bq0mrVgCqLf x1T+zX2UEoyhoNjAtFfbqWVrfkiTEOQgmSey/VdkUIpf0fU01+uwkeWalnl4rwe/xOpR PM/nv5MQrRj/emiBlG5mnjCwY8/tv6unrlWQWjcXhL5PhcLCyJP7PxG9o1jowfHvCDvP u3nI6JAFcxvxlccGoCnjuWhhU9n6T6bNnf1jhP6VDxcBFciWyuFNM6M/ae0l0vKlmhvf gfsuHacrMoew2oeFcXKZJ9eQWSKSfOIbd+Gj6LJ3JGiPD1qn4dKXDuu7yo2S0SQ5EoJu tK/g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja11-20020a170902efcb00b001b3e073e157si10787606plb.125.2023.08.16.01.53.11; Wed, 16 Aug 2023 01:53: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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237487AbjHOOGc (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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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 -- 2.39.2