From nobody Mon Sep 8 16:20:24 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E122C64ED8 for ; Mon, 27 Feb 2023 11:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbjB0LsX (ORCPT ); Mon, 27 Feb 2023 06:48:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjB0LsR (ORCPT ); Mon, 27 Feb 2023 06:48:17 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312501E9EE; Mon, 27 Feb 2023 03:48:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1677498451; bh=CI8s0gM0tMtJHBxeXCTI0IQpxz9851TtDO86l4aVjx8=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=dJliIvk6QlvwU3rCzUk7QBq8DjwevOBDejXxpnGzrv5IRr35EL9X+AqYuXMlkhaBZ rA4TE7VY6Drey4OqIjNoESTa/LM0N9qYlr1cSr6j7eAjQu4C3E4b5jMK1WnrbuMku0 qo7RAi3ekl3i4jnj2hO9r0hCJfIVVXR4Axqs7SmQ= Received: by b-1.in.mailobj.net [192.168.90.11] with ESMTP via ip-206.mailobj.net [213.182.55.206] Mon, 27 Feb 2023 12:47:31 +0100 (CET) X-EA-Auth: vnFL1j1Pzw06bs3ZGVnme+e34tOLBxQ0GRjIE9QE87xaKerSboINzXlNieTuym4CdlL72C+mDKJR3y52TlF1tA== Date: Mon, 27 Feb 2023 17:17:25 +0530 From: Deepak R Varma To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: [PATCH] perf/x86/core: Remove repeating test expression Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Current implementation already checks validity of the cpu_type for the hybrid pmu two lines above. Hence there is no need to again include it in the immediate if test evaluation. Signed-off-by: Deepak R Varma --- arch/x86/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 87a7f0cd77fd..89db2352deb9 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1893,7 +1893,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev, for (i =3D 0; i < x86_pmu.num_hybrid_pmus; i++) { if (!(x86_pmu.hybrid_pmu[i].cpu_type & pmu_attr->pmu_type)) continue; - if (x86_pmu.hybrid_pmu[i].cpu_type & pmu->cpu_type) { + if (pmu->cpu_type) { next_str =3D strchr(str, ';'); if (next_str) return snprintf(page, next_str - str + 1, "%s", str); --=20 2.34.1