From patchwork Thu Aug 18 21:00:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12947887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2911EC28B2B for ; Thu, 18 Aug 2022 21:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346328AbiHRVA5 (ORCPT ); Thu, 18 Aug 2022 17:00:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346203AbiHRVAL (ORCPT ); Thu, 18 Aug 2022 17:00:11 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2C375CDC for ; Thu, 18 Aug 2022 14:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=3bhGjXlunu1Ky50yLFmozK7YmVk 5YkPEAtEsl/6IeWY=; b=li9exWJenzm6pNVt5A1UhRIb0f76EoAO3KlaZNLXem5 zxpg9xPErofGBr1h/ZY5muLrR1jWp21zTf6ElwUkDbR7BLTTp07ZQYH8nuDYwVp5 pXMOayprPkTQWWFjrAyB/P1UWY6XWlAfCqmd5z2HjND2ahG92Jl0mzhrzcILAt7E = Received: (qmail 3959703 invoked from network); 18 Aug 2022 23:00:02 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:00:02 +0200 X-UD-Smtp-Session: l3s3148p1@ZV7gQ4rm5ZEucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , "Rafael J. Wysocki" , Daniel Lezcano , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] cpuidle: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:00:01 +0200 Message-Id: <20220818210002.6624-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- drivers/cpuidle/cpuidle-powernv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c index c32c600b3cf8..0b5461b3d7dd 100644 --- a/drivers/cpuidle/cpuidle-powernv.c +++ b/drivers/cpuidle/cpuidle-powernv.c @@ -233,8 +233,8 @@ static inline void add_powernv_state(int index, const char *name, unsigned int exit_latency, u64 psscr_val, u64 psscr_mask) { - strlcpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN); - strlcpy(powernv_states[index].desc, name, CPUIDLE_NAME_LEN); + strscpy(powernv_states[index].name, name, CPUIDLE_NAME_LEN); + strscpy(powernv_states[index].desc, name, CPUIDLE_NAME_LEN); powernv_states[index].flags = flags; powernv_states[index].target_residency = target_residency; powernv_states[index].exit_latency = exit_latency;