From nobody Sat Feb 7 21:52:57 2026 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E26F71BC46 for ; Sat, 31 Jan 2026 12:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769862075; cv=none; b=rMxXs5hmaIqF0wowszrXBZScr68drj2ikQnZJHRnkXKw8TE8CFkUanvIRE3FooC5Yl12KxAg+AenwbabGQLpRZYnCys5XiP48qvr29apC5vTaG+J06QcfC8usTMNomO1iu98IclYSmnWOPOgp04iG4igoQR7QQevDg4dQjkrduw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769862075; c=relaxed/simple; bh=ce+xZ0tVIkPAsDh+t2U2zmU9Shn59VfM21GmyPRjCO8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P+zBwWW5QGSj9EGE44FWTMHRq+3SdfX4m82B/4L0dKLZd/UFsQYBXCHHEacYelxK0jQb5pneMmr880WRFI33WtyCdmgHyPh+uxq5VcQRTjGVRZNaIFA9GGaWlufEB1GRHtN95ZkO93THqJpL7Y/13KaIi/+KcOC1MBL7UGAyM1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ot6gdGQE; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ot6gdGQE" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769862061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RdCu0tG0qwMotI16SIbFepy6PpQ5BtE+3HxR03F4TJg=; b=ot6gdGQE77PG9bjPil/3NSmkZ7SJvW22m555LF1c2ok2mZWSiSm8Xd5NzyBzo/C5ZSEQFH oZvzlTz1ivHjP1BM8vPXadt9fHKyWnoEYUimIO3ay4CXbs/eK4n9t4On9w/RSU1qBJJSfx 5EOtomPgPFzpK6KcChw55uMVQR1W6iY= From: Thorsten Blum To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: Thorsten Blum , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf/x86/intel: Replace snprintf with strscpy in intel_pmu_init Date: Sat, 31 Jan 2026 13:20:11 +0100 Message-ID: <20260131122011.492961-2-thorsten.blum@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace snprintf("%s", ...) with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum --- arch/x86/events/intel/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index bdf3f0d0fe21..025971ab6341 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -8077,7 +8078,7 @@ __init int intel_pmu_init(void) } } =20 - snprintf(pmu_name_str, sizeof(pmu_name_str), "%s", name); + strscpy(pmu_name_str, name); =20 if (!is_hybrid()) { group_events_td.attrs =3D td_attr; --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4