From patchwork Fri Sep 13 21:11:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdul Rahim X-Patchwork-Id: 13804080 X-Patchwork-Delegate: rjw@sisk.pl Received: from sonic312-20.consmr.mail.sg3.yahoo.com (sonic312-20.consmr.mail.sg3.yahoo.com [106.10.244.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB4CB1474B2 for ; Fri, 13 Sep 2024 21:13:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=106.10.244.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726261991; cv=none; b=ePG7hzyRzAdqgAbqNJbJSiBNTSgxyaylqKGj4M3KfL6stuO54Y1D0S4+/qxa9FkNCC6JNIMpn6h71821IhrkmSZN3HzmNMr8uLG0XsVSx018MGpw0IbLj9xUBTCVbmVFhyH34ZXkmMLpH7c0ut31T5QTCkvtqKR53koGdBZsX68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726261991; c=relaxed/simple; bh=2so5/dlwuaehvsB5jpWp6d3aG+AwuUtDaEHHBeVGxAg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:References; b=SVrp0olMg4EFvXXKWokVlChvHbHgG34UHiZAs22cZQnQtesxNXQQyBq7NRq1yykqVMwhMs7xou9Y6wczQmuqo8v5dPZxAVKtL03pTdMafY2MaHeAHTVGxYCJowsimKyUsUSWDPrQ4Wz2ydgPoPXKTaezk6v9B4P8eeUwJj7240Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com; spf=pass smtp.mailfrom=myyahoo.com; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b=gmU668Pk; arc=none smtp.client-ip=106.10.244.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b="gmU668Pk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myyahoo.com; s=s2048; t=1726261986; bh=1EOOzYwmZxr/eQ2GSdm3AxrZXyHasBU1ASee1LLS1z8=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=gmU668Pk7heU4Ay546tEJndsAjm1g2g510fpEdLaVszKJi2kPZT76q7EuBG/D2aT76kHqL37t7wfsBgIWm0h7H/zEp9fTv5ua5pyX9C35Gda/CdHG26waR8qCuY6sJDdOD8hGSvVawu86OjwCbLH51R08hD72v3SvHf0U330Y5h9cddKpfhitLPTpiT/hOMk/g0gVUSLJxKdv16QpWyk9cTnZGSxQLmQfiVMPkNRaIDBk4+/vjIQUCy1528tyVP9wCONgDAAcVNNLD42gaNKrQFbax5IwJdjo7btaikfoQnQAy6UuWKnl4TKLOBRuGdi1inT0cP/yobb7KFz4sBTBg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1726261986; bh=WPq+O9N+spu+46Ch4h7/bdNUPibvIhat5Hb58x0IMf4=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Mevs2nx9JFtqcPfZTYGFPrWru8zN+ZAj8h2wMoJZ9GL61AuYLbJhrn71OBEZJrkPH3+24WhotAQkBBrF5K+98bJkMA36SxTlJRBzF62yHnJc8sXY4xzKw1vlyDUAjoqE/p/VDdquznEocruJeIM5Ujtvt1tls+It1SAQllfxcLsQMU86rqCdKWmukVu4s35FyDR0i1t7FNFuvJiwD7vo1V6SqRzf2ReTEVt8hRqlw+rbTnYaMNzM4XNDkhby6wi0DIfMABvMv6Xg/diYAb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2CFK9WD_acdu7Pw7K_mvbdnP2uPxiVktITSJVwz2HsDuF5v6sAK 0G.mmqse1L_Ap5jd3sOm3UuPGGoRXPj8MVpcH22pGnK469lX3xUGhF72Z8Sz_ODXUsFNHHcDyOwS 3UjuaJlygrFQwOzWK1hVbPhWjm2685XiUKtUuiBHfYrAtJRibTLF_gT.xMrf7fkf7ZCMha35WDQW rt3KUK0ieE.4mQme1yhV3jqYz3lmsSJIa_rGnjO_KFvZeMlW.hVOrnhrs9tMZ X-Sonic-MF: X-Sonic-ID: 800d228a-dc28-4feb-b880-57b6f9c12796 Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.sg3.yahoo.com with HTTP; Fri, 13 Sep 2024 21:13:06 +0000 Received: by hermes--production-sg3-fc85cddf6-kdpzj (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9bebe123c7193dfe864d6d02fc719e39; Fri, 13 Sep 2024 21:13:05 +0000 (UTC) From: Abdul Rahim To: rafael@kernel.org, rui.zhang@intel.com, lenb@kernel.org, christophe.jaillet@wanadoo.fr Cc: Abdul Rahim , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ACPI: thermal: Use strscpy() instead of strcpy() Date: Sat, 14 Sep 2024 02:41:35 +0530 Message-ID: <20240913211156.103864-1-abdul.rahim@myyahoo.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240913211156.103864-1-abdul.rahim.ref@myyahoo.com> strcpy() is generally considered unsafe and use of strscpy() is recommended [1] this fixes checkpatch warning: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Abdul Rahim --- Changes in v2: - Remove an unneeded extra parameter (MAX_ACPI_DEVICE_NAME_LEN) in the 2nd strscpy() call v1: https://lore.kernel.org/all/20240912205922.302036-1-abdul.rahim@myyahoo.com/ drivers/acpi/thermal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 78db38c7076e..6671537cb4b7 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -796,9 +796,9 @@ static int acpi_thermal_add(struct acpi_device *device) return -ENOMEM; tz->device = device; - strcpy(tz->name, device->pnp.bus_id); - strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); + strscpy(tz->name, device->pnp.bus_id); + strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS); device->driver_data = tz; acpi_thermal_aml_dependency_fix(tz);