From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 A791A3E63A6 for ; Mon, 27 Apr 2026 17:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311485; cv=none; b=U6a52teZu0Dx6IdPuYcslpq0n0b6I4xA1hst5qvBvjBThXO65961FVG65nNp4PYY5GLUClQRwKS/5bJ6YoG41acmE2reX7je3v8Zub1O1rcJ1imlst78XvVH7UmuB67yI+m6O1Nvjay6rF7bpvCZUaft7OKrwhvT16ZjWx1Ms7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311485; c=relaxed/simple; bh=tghg4ohdtaq3vXwk0nxxKyWh1IosIePdBi53j8YnbZA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e1aY2r3Gt7qQLXObSMX7MBiH4qPnJ300XgrIE6JX3tw71ufREpxun3hxgFsINF4X98rULlZ9GMU24yr16B1YjVeSjd33yqVvTxsoaJE7ZDdRcQ0CnlwKyp3P03T0GjMjtUOKYcCGgxmzhzYy916YwOEudkm3pmaTe4EF7XG3V+s= 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=kOThD9rC; arc=none smtp.client-ip=95.215.58.174 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="kOThD9rC" 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=1777311479; 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=aKn0A8/nI5EasCR1FO0TxTdvbQKKJ53vvncp6FkZ9Ts=; b=kOThD9rCx7ZCAyjZW2jff56WB9ssCA9VBKl/QZRpX9lkCMa1MTjbMQN7Eqh94lVwR9Gb05 K+aqu6KYx8i0RYOZgsYQJ7BK7hr+nU4LKLGxFoNh38sICo+Lxa5ugLnWXXtjPpoU/fPyZA n5/hk4TsbdVGoXVT8X4JnRBaJmCiHEA= From: Thorsten Blum To: Eli Billauer , Arnd Bergmann , Greg Kroah-Hartman Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH] char: xillybus: use strscpy() in init_chrdev Date: Mon, 27 Apr 2026 19:37:32 +0200 Message-ID: <20260427173730.418592-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=978; i=thorsten.blum@linux.dev; h=from:subject; bh=tghg4ohdtaq3vXwk0nxxKyWh1IosIePdBi53j8YnbZA=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJnv593qNb7bsH8DwxrReLGD0y0jOF/t+7kwdMJf1tytP 1kSlervd5SyMIhxMciKKbI8mPVjhm9pTeUmk4idMHNYmUCGMHBxCsBEmFcx/Pfw/7lTruBKvPRu r108UhOmRV5ZVutmlVu2t9Xki61q/SWGvyL2UTEbBbeLHFZbz9fDfbfvy6viS85K/Tub1tg87zm uwwoA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The format specifier is unnecessary and can be removed. Replace snprintf("%s") with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum --- drivers/char/xillybus/xillybus_class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/xillybus/xillybus_class.c b/drivers/char/xillybus/xillybus_class.c index c92a628e389e..bbdfa3e87514 100644 --- a/drivers/char/xillybus/xillybus_class.c +++ b/drivers/char/xillybus/xillybus_class.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -65,7 +66,7 @@ int xillybus_init_chrdev(struct device *dev, mutex_lock(&unit_mutex); if (!enumerate) - snprintf(unit->name, UNITNAMELEN, "%s", prefix); + strscpy(unit->name, prefix); for (i = 0; enumerate; i++) { snprintf(unit->name, UNITNAMELEN, "%s_%02d",