From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 AF28C3E9F6C for ; Wed, 18 Mar 2026 15:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773848641; cv=none; b=aUpYMI9+MwU+E6/MoavMZ+iwTXKrpLmVum4Ebwtz2WqXENHPxzSRWz0xy01JaU4JfIjwH3ORjAxWcp8r86KGlAHNYxBPMUrMEoT6KEMzb/YCA1WlKzBZE/G2Vqbi6iMz4ypkgqcsgsm1Cpt0gir9cPMM5dGs1faPaopgBCHW7k8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773848641; c=relaxed/simple; bh=6Cj5ZZ5xMaulKlmWQvRvEYPRvzXfhMVFVVnXv4K5F9c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SzbsM2VgSCo2LsRTyEeuGq7JyIkIVpr/eIfxJ/GNvsMcbnf7rrXWo1k2e39uD08YaupK3bSUu/EZkuHUWlNAh1xAsflm0KWzIxb/2/V34acYPiB7c32e99T2Ie3gat/Qr3PFF2sEoUxUy+3QuA0t5iDXjrzJMtRtzQhMfX8m7P4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Cravn6rx; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Cravn6rx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773848636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uzCirBensQKmFXzqPfMtfdaWdeb7KA78ZtYZNWEpdBY=; b=Cravn6rxJVyhiFJirlqZrtbsj6cB+8AY0QqJLKkt8nBJkxzbi/YBXYbgNAdTdbLJB92SaS 1iAgx5W7ud842nWV+zv1GTrA3KbGQjkmiquMM9VzkjY0dOAwg62WzvTdgpmRJ95I1JWe9c BZChF1M6JRjJaPHVuYj6vRtV+n/GwYg= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-NufBtBVsPviw3PRpBfNodA-1; Wed, 18 Mar 2026 11:43:53 -0400 X-MC-Unique: NufBtBVsPviw3PRpBfNodA-1 X-Mimecast-MFC-AGG-ID: NufBtBVsPviw3PRpBfNodA_1773848632 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D0506180035C; Wed, 18 Mar 2026 15:43:51 +0000 (UTC) Received: from [10.22.81.226] (unknown [10.22.81.226]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 019811800351; Wed, 18 Mar 2026 15:43:49 +0000 (UTC) Message-ID: <1a5b1a90-6445-4949-abce-6ec799b959b1@redhat.com> Date: Wed, 18 Mar 2026 11:43:49 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND] locking/lockdep: Replace snprintf with strscpy in seq_stats To: Thorsten Blum , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng Cc: linux-kernel@vger.kernel.org References: <20260318001426.2664-3-thorsten.blum@linux.dev> Content-Language: en-US From: Waiman Long In-Reply-To: <20260318001426.2664-3-thorsten.blum@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 3/17/26 8:14 PM, Thorsten Blum wrote: > Replace snprintf("%s", ...) with the faster and more direct strscpy(). > > Reviewed-by: Waiman Long > Signed-off-by: Thorsten Blum > --- > kernel/locking/lockdep_proc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c > index 1916db9aa46b..e458fa258d05 100644 > --- a/kernel/locking/lockdep_proc.c > +++ b/kernel/locking/lockdep_proc.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -488,9 +489,9 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) > const char *key_name; > > key_name = __get_key_name(ckey, str); > - snprintf(name, namelen, "%s", key_name); > + strscpy(name, key_name, namelen); > } else { > - snprintf(name, namelen, "%s", cname); > + strscpy(name, cname, namelen); > } > rcu_read_unlock_sched(); > > Acked-by: Waiman Long