From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 2F78A33A02B for ; Tue, 21 Oct 2025 13:52:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761054737; cv=none; b=bu5Ow8g27EiDBCKUrFchEC9ye+QJ/mqONfRTpMB3AH7fE2lWtniuTvf/aZa9DHc31wtQ5HwQqQVYTQ96HGj8aBNTXnyQLyFl3JzQdcTbPSrgWyRww7PqyLRJ9zyQ6gNl3gQdeMqo8mo9YLFiyzEOSkBRwv3ytI7ehqf8Iiuzhrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761054737; c=relaxed/simple; bh=KcoZRlMIRQYTtUsbeUmLMcynfUy20gbDZvC2+z6HaGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dvD9NcAbIpCPF3YsBWh3PSiFzoq/7HNvQ/0ZaLkRIz4Flw+O8+BxYKXaiGoSl/dmPKfE3gvgZ+hUzGP7AmjylVncOPUApmkL1/CULxhqjkoftRU0YEQf9mjBtBZI5zJlnXuBg9jJjcqlR1HWZaiALPq4I6WGv8QOSt7XEFvNu7M= 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=vJhlH2k/; arc=none smtp.client-ip=95.215.58.178 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="vJhlH2k/" 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=1761054732; 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: in-reply-to:in-reply-to:references:references; bh=QuqX+DVA3hI2/d+SyUtCBAKfn2WnwnI/ZTaEyd57HEk=; b=vJhlH2k/IXH0+K+ZOmlfs3G9ac+QbvdJbaeQt5QuSjnbmpLZfrJLBx6f+l7HcIYK46qRFG SJnlxx+rL+2dSwjo/e3M+s/vpghs599PE65LqJC+G7wSMB3oih3gySCbZaRUgo4pK7CgiJ 1t3WGX7Eq06L7sG/5CTCo2QxhPhSO3w= From: Thorsten Blum To: Anup Patel , "Rafael J. Wysocki" , Daniel Lezcano , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: Thorsten Blum , linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] cpuidle: riscv-sbi: Replace deprecated strcpy in sbi_cpuidle_init_cpu Date: Tue, 21 Oct 2025 15:51:54 +0200 Message-ID: <20251021135155.1409-2-thorsten.blum@linux.dev> In-Reply-To: <20251021135155.1409-1-thorsten.blum@linux.dev> References: <20251021135155.1409-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@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. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum --- drivers/cpuidle/cpuidle-riscv-sbi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c index a360bc4d20b7..19be6475d356 100644 --- a/drivers/cpuidle/cpuidle-riscv-sbi.c +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -303,8 +304,8 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu) drv->states[0].exit_latency = 1; drv->states[0].target_residency = 1; drv->states[0].power_usage = UINT_MAX; - strcpy(drv->states[0].name, "WFI"); - strcpy(drv->states[0].desc, "RISC-V WFI"); + strscpy(drv->states[0].name, "WFI"); + strscpy(drv->states[0].desc, "RISC-V WFI"); /* * If no DT idle states are detected (ret == 0) let the driver -- 2.51.0