From nobody Thu Apr 2 23:57:14 2026 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD5F52FB969 for ; Sat, 14 Feb 2026 15:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771084158; cv=none; b=plKWbb9ZqKN/yllCXcrfhbVnD/nDHxWiluef8vmhmFtyg1eFYPD1rZ5rWyTZwx8Te/A8yqr4L0D9leoA0zLyOFlJ/IvGjqVb0kXsUe/w8IvCCLTfwXpGapc86y+T+cEUhMgrZOvU8a0ethRF1+cE0DZawimxl5+0w2n+RYE5yKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771084158; c=relaxed/simple; bh=gO5XKTbGTCNX9F2kGpffpU86Ne6W69soNa7yYuB8rEs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RozsVsXt0Y00JubvLUUecJIpPG75l64wl2e/biA6do9avXI98KePqzOXOUu8vYBG8AWWbfbwAYa17UKqO29JJ8Ua7dydjuNj2v2oloVmjCKM7YGdrJSkYb9XDhXaTvqdlIw0gl/Sju6T+hWWaaBMna0ScpdNJ/pjYO3gro1W9bE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Sv6vb/59; arc=none smtp.client-ip=209.85.214.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Sv6vb/59" Received: by mail-pl1-f193.google.com with SMTP id d9443c01a7336-2a7b47a5460so21949425ad.1 for ; Sat, 14 Feb 2026 07:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771084155; x=1771688955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HQ3C3N6ai9LWpoELJlhPWsjarYjJZBYa3nbCsM7NzMU=; b=Sv6vb/59YzoiaGR2IEoxp8iVLRJhDhLlxqlKiRZlzzQnH6Nj6zBVHjeDJN6YqQaLtO BH0acrkXTwH4pK7r6QPIuOBSy/+aPlKnqP4QGFbPUhje0X0tL2BHkb0rfiv1deRDdCQL QkvNOYUfy+fViNlFJth8CCu1yMlvRBaDlk9+qgRNiv2nZe4IE4KxfCEq2dfYmkaBWMIL CR10Ex3ZbJhzTg1mkKK8Gmr9+ASEeEDHKYAa7hcAChNG6j1jQElD/nUbroV0VRQRm5Km ZzO3YwQPb51Cr35F1jGTrGscGGnyqnnS4qf7VaC5CnTART5BMyfVAkeeeedZ8HM9PmlT t7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771084155; x=1771688955; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HQ3C3N6ai9LWpoELJlhPWsjarYjJZBYa3nbCsM7NzMU=; b=nHo84K1pHEI/gY71j+35GsVq1PNO0UfpIfpyoKTkUbIO84pZc8e4emKoZDpiEqli/A b8mFbeKqisFesgPlGjTcT33pAI/wnmMEfFlDTbk/ps5wsDrthva93wC19JQLTlE80a+N PUl7obuXt0+wRwDn0LwrUCrcS4Va79SKvv/MOOcHdkxTsRPR+FXUaA+6AUzWlD9XHSSf obHtDcWHNZQqlKCkRLbnZDQGwjw0eToG/BKfURugPcq57EXBlWt4pg0uSJY35QMOoJbt UR5AJJ8cYrt3wqK2lN98NSJFG3mU5q/DWDEoyNywmJwxvQV2kGhUUMwvhskeZNm3Po+T Q1sw== X-Forwarded-Encrypted: i=1; AJvYcCW2Ki6uqrlIL0pb+SzAlssZgYHBs+lXCBDtAogS3dXF+9ZKoTrie/u+sjW37fYlNs8A3ZdgtjbwGO0GUrw=@vger.kernel.org X-Gm-Message-State: AOJu0YwOF9TVyqTKAMqwx1TFpJNmz6zsuGP/9y8ViHFizsCd6BixOlow aXxAd2wdqHigEs7lQBt2hr5t8zdiUpR7WkfD1FKPPeOZJb9vDzR3IpcE X-Gm-Gg: AZuq6aJMWl6qn7GHh5YgU9j2/Llsleg2ndiLRwrQ1kAFXzah4XWsroSvDGAxkE3QVU7 iZwpKIyHOOWe5GP8dSqjjMJZV8hU6BdZ+pzuq8yj2Dxr46F0Xl7cfe4OYj8E5wjfe/Vpa1VA5nm jDbBcbhKAI4SQ8iXmzZwXxWNQ81Mv+gHVLtK9nTldS4nNCJu5cuxbw9E7s+EONBHoHFz6SlVnNb NfW6dAQHZFWpu4W6zl1vFnfSFUaM1S4dyt+MhZr0y+XfSgIbgWtKldNebhaNtvaJfDNDinrUW1Q IFnJsAq0v1kxurSar+69FHaxW+3M354+Q+kRLdpA5L1VegLG28aR+boG2J0gRptASi03VXBi6Bl cagu9C4IgSDZ9igaedDFyJS0ILZF5TRXGS9drZoRSApxr/2c4IApxXBcTaP06CmOaUBZMNCHEWU TC6lYasNUhobIxWhmMpM5B52gBdDmAnvclm2uhVU+gSAV8LKw1f9U= X-Received: by 2002:a17:902:ce11:b0:2aa:d320:e965 with SMTP id d9443c01a7336-2ac97593e35mr28414925ad.21.1771084155016; Sat, 14 Feb 2026 07:49:15 -0800 (PST) Received: from localhost.localdomain ([202.161.55.15]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad1a6f9c5bsm24662435ad.15.2026.02.14.07.49.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 14 Feb 2026 07:49:14 -0800 (PST) From: Yunbo Lyu X-Google-Original-From: Yunbo Lyu To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, richard.henderson@linaro.org, mattst88@gmail.com Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, julia.lawall@inria.fr, ratnadiraw@smu.edu.sg, xutong.ma@inria.fr, kexinsun@smail.nju.edu.cn, Yunbo Lyu Subject: [PATCH] alpha/perf: Clean up stale comments referencing old hw_perf_* APIs Date: Sat, 14 Feb 2026 23:49:04 +0800 Message-ID: <20260214154904.37655-1-yunbolyu@smu.edu.sg> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Two outdated comments in arch/alpha/kernel/perf_event.c referred to functions from the deprecated hw_perf_* APIs that were removed more than a decade ago: 1. hw_perf_disable(): This was superseded by per-PMU disable APIs such as alpha_pmu_disable(), after commit 33696fc0d141 ("perf: Per PMU disable"). The comment has been updated to reflect the correct function name. 2. hw_perf_group_sched_in(): This function was removed in commit a13c3afd9b62 ("perf, sparc: Implement group scheduling transactional APIs"). The corresponding comment mentioning it has been removed. The if (n_ev =3D=3D 0) check in alpha_check_constraints() has also been removed, as this condition is never true. The alpha_check_constraints() function is only called from two places: - alpha_pmu_add(), which calls alpha_check_constraints() with n0 + 1, where n0 is the number of existing events (>=3D 0). - __hw_perf_event_init(), which calls it with n + 1, where n is the number of events in the group (>=3D 0). In both cases, the n_ev argument is guaranteed to be at least 1. Therefore, the check is redundant. No functional changes; comments and dead code cleanup. Fixes: 33696fc0d141 ("perf: Per PMU disable") Fixes: a13c3afd9b62 ("perf, sparc: Implement group scheduling transactional= APIs") Signed-off-by: Yunbo Lyu --- arch/alpha/kernel/perf_event.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index a3eaab094ece..2f57626ffcfb 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c @@ -35,7 +35,7 @@ struct cpu_hw_events { int enabled; /* Number of events scheduled; also number entries valid in arrays below.= */ int n_events; - /* Number events added since last hw_perf_disable(). */ + /* Number of events added since last alpha_pmu_disable(). */ int n_added; /* Events currently scheduled. */ struct perf_event *event[MAX_HWEVENTS]; @@ -372,10 +372,6 @@ static int alpha_check_constraints(struct perf_event *= *events, unsigned long *evtypes, int n_ev) { =20 - /* No HW events is possible from hw_perf_group_sched_in(). */ - if (n_ev =3D=3D 0) - return 0; - if (n_ev > alpha_pmu->num_pmcs) return -1; =20 --=20 2.25.1