From patchwork Thu Aug 18 21:01:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 598871 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 69B67C28B2B for ; Thu, 18 Aug 2022 21:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346652AbiHRVLV (ORCPT ); Thu, 18 Aug 2022 17:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346726AbiHRVK0 (ORCPT ); Thu, 18 Aug 2022 17:10:26 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4295CD87F8 for ; Thu, 18 Aug 2022 14:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=TnOhOaj1AOdpv5 hMo0BFM6kxooVXj5LyGIFYJdL5GEM=; b=yzyLb88m0N1H50OBCatFaVmNZGNfNz juE1DWL4ELnAADRJDytcx+LCzLAivk/SC7WJJe4dY8wkWe8rwt1joTNc6+4tXn/Y iqkEJZsWfE9HzT6RRaPPTNPkEmMm1RCln11XW8ncixMeQzEo49EiEvRUfAvjNsFP g/diLCvYKwW6Q= Received: (qmail 3962647 invoked from network); 18 Aug 2022 23:01:58 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:58 +0200 X-UD-Smtp-Session: l3s3148p1@e1O/SormYdgucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org Subject: [PATCH 2/2] PM: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:56 +0200 Message-Id: <20220818210156.8143-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220818210156.8143-1-wsa+renesas@sang-engineering.com> References: <20220818210156.8143-1-wsa+renesas@sang-engineering.com> 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 --- include/linux/suspend.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 70f2921e2e70..23a253df7f6b 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -75,7 +75,7 @@ extern struct suspend_stats suspend_stats; static inline void dpm_save_failed_dev(const char *name) { - strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev], + strscpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev], name, sizeof(suspend_stats.failed_devs[0])); suspend_stats.last_failed_dev++;