From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 CBA15340DB7 for ; Mon, 5 Jan 2026 13:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767620349; cv=none; b=vGmGU6s4HawTEWAcd3HJuFRQOnPA59+A6JGxmVBUjrUcP6oLsJwr7p4z4IFsSYE68FJS1OJ6oD1KUdp8HwZy8scKmS/48FnClZeuxBOQg3AMLSuggPH7RhEVW7OnbVBlyugyxQFR/GXMVOEOnNAg5brJ4HVEdM7Kvfj/HbEl+1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767620349; c=relaxed/simple; bh=DaehwTkILBy0lvSpZA2L8CcnA3tayVgPPgIH7uQ9Nik=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=hmqhPmdHPFkF+H6SOw5XjYSghCf+0UxUz4UokxVv0XlYt6+RbI0vNvt8Acd9h08qwBzHVq9N1WjaCqb8gAMltF0LKDEADw2gpudi+zh3W4dCiQk3MnBUrfHLoWeRIYkRpKDNsbsbDc/HIYs+jKz9Ktqd+qfDpRSg/8bOLZL+FJ8= 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=tGuXJla4; arc=none smtp.client-ip=95.215.58.176 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="tGuXJla4" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767620335; 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=9VBcF7jLhQbFtOVHzZtw8nYLDmL9TQxCrZlPawWNM6A=; b=tGuXJla4vCKC4s6+AktlIzgjvWQAbqcpQ57XnuZ6596HWt+bUbgpo6BGIoUUuqlMjKGLF1 NfUux2n+7lzwBXfeuLDmxE8zFlLjeFOV3Xr78txTyriehjfDRY/ITgvmKqGS9ErnETJopM d3GON9ff6yRm0Po/aOh/vwEE1wdmqkM= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81.1.4\)) Subject: Re: [PATCH] platform/surface: Replace deprecated strcpy in surface_button_add X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum In-Reply-To: <4cadf166-2693-489e-a6f7-ae986694fd88@intel.com> Date: Mon, 5 Jan 2026 14:38:22 +0100 Cc: Hans de Goede , =?utf-8?Q?Ilpo_J=C3=A4rvinen?= , Maximilian Luz , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20260105121802.1947-2-thorsten.blum@linux.dev> <4cadf166-2693-489e-a6f7-ae986694fd88@intel.com> To: "Chen, Yu C" X-Migadu-Flow: FLOW_OUT On 5. Jan 2026, at 13:52, Chen, Yu C wrote: >> - strcpy(name, SURFACE_BUTTON_DEVICE_NAME); >> + strscpy(acpi_device_name(device), SURFACE_BUTTON_DEVICE_NAME); > > Thanks for the fix, a minor question might be why we do not reuse > name by strscpy(name, SURFACE_BUTTON_DEVICE_NAME) ? Because 'name' is a 'char *' from which the size of the destination buffer cannot be inferred by the 2-argument version of strscpy(). Using 'name' would force us to use strscpy() with 3 arguments: strscpy(name, SURFACE_BUTTON_DEVICE_NAME, MAX_ACPI_DEVICE_NAME_LEN); Thanks, Thorsten