From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 C741828E579 for ; Thu, 19 Jun 2025 14:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750345105; cv=none; b=Ay55EgGCiWoJKCc6CZVHjQthEebLGyVOsIY8Z7J/IZ1kfzo7me6XhO9YU1lhdsQluoqw6FU/dzEMvN3z2+Pz5cACHKBqCkwC4H3Xiaaxn8ldCImq87Q4/1W6aTgZe+HQszSG/XNZ3q7QquI/j9JYkrJMvOwH+v0eccyqYlHOkZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750345105; c=relaxed/simple; bh=GbdOj3vJ/q4X+/2t6OHFHhPM4HGzw4Vsiy/W4r3FnA0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ircjZW6Q61+G/+QRgRh4M/2qzD0Kb/pY+3ppAVu1BJGwZmbxIDrYracmgPxgZhYXu9IDjVIy8VcBpZCvsidtC8nacDb1sD0b2QMlugmUhQTkmlDpU2T+RG2ugWsfvaOwk32kb+myfVwXjSp50r5GJk5Jc9XEds+peaj3cvMF0LM= 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=X6TZWCD9; arc=none smtp.client-ip=91.218.175.181 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="X6TZWCD9" 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=1750345091; 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=Q9TvMyMwPK6rkSNheoWI19m/ZeeUWO8Bp2DZADsG/EE=; b=X6TZWCD90sSZM9Q89BopqjTuweQk/EkFH2qeGCVx6gRJwqh9UVXxs/umJAspInvfvCmv6q iErrlFtK44z+JMMHQquSNTwlLYLWYGPAKR17sf/qIRahNysM9ew4OJk1exqvHWfQHWUA9A r9uETuFTx4VXT79dDByc+7XOziT+1GU= From: Thorsten Blum To: Richard Henderson , Matt Turner Cc: Thorsten Blum , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] alpha: Replace strcpy() with strscpy() in setup_arch() Date: Thu, 19 Jun 2025 16:58:04 +0200 Message-ID: <20250619145806.174567-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-alpha@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT strcpy() is deprecated; use strscpy() instead. Since the destination buffer 'command_line' has a fixed length, strscpy() automatically determines its size using sizeof() when the size argument is omitted. This makes the explicit size argument for the existing strscpy() call unnecessary - remove it. No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum --- arch/alpha/kernel/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index bebdffafaee8..8b51e6ca83d6 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -468,8 +468,8 @@ setup_arch(char **cmdline_p) /* * Locate the command line. */ - strscpy(command_line, COMMAND_LINE, sizeof(command_line)); - strcpy(boot_command_line, command_line); + strscpy(command_line, COMMAND_LINE); + strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; /* @@ -511,7 +511,7 @@ setup_arch(char **cmdline_p) } /* Replace the command line, now that we've killed it with strsep. */ - strcpy(command_line, boot_command_line); + strscpy(command_line, boot_command_line); /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { -- 2.49.0