From patchwork Thu Aug 18 21:01:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12947912 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 A00F2C32792 for ; Thu, 18 Aug 2022 21:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346257AbiHRVGF (ORCPT ); Thu, 18 Aug 2022 17:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346609AbiHRVFu (ORCPT ); Thu, 18 Aug 2022 17:05:50 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5786BD41A6 for ; Thu, 18 Aug 2022 14:02:45 -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=t7Ii6XLIRaP7at2yUuRIiz03+D4 RJlp1wSYdcFu6j6M=; b=oI1fYcGq6IUXrcsFkfdcZDXWr9xd3PTb4KgW5JaMIsH XZ6ZtLfgO5XLUgH4KN4Q5E/WkZkVBk7+dohi3eC5lcH275XgUS1BbqlK+YedkyQv P4sUqELpeuCvqJwIw5tP69rv3t+uwelrKgfL4kapaZ9yxPLldvBUG+9K3E9ZWRg4 = Received: (qmail 3961254 invoked from network); 18 Aug 2022 23:01:01 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:01 +0200 X-UD-Smtp-Session: l3s3148p1@M0dbR4rm8LIucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH] rpmsg: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:00 +0200 Message-Id: <20220818210100.7277-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-remoteproc@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/rpmsg/qcom_glink_ssr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rpmsg/qcom_glink_ssr.c b/drivers/rpmsg/qcom_glink_ssr.c index 776d64446879..39ffa384c9b1 100644 --- a/drivers/rpmsg/qcom_glink_ssr.c +++ b/drivers/rpmsg/qcom_glink_ssr.c @@ -111,7 +111,7 @@ static int qcom_glink_ssr_notifier_call(struct notifier_block *nb, msg.command = cpu_to_le32(GLINK_SSR_DO_CLEANUP); msg.seq_num = cpu_to_le32(ssr->seq_num); msg.name_len = cpu_to_le32(strlen(ssr_name)); - strlcpy(msg.name, ssr_name, sizeof(msg.name)); + strscpy(msg.name, ssr_name, sizeof(msg.name)); ret = rpmsg_send(ssr->ept, &msg, sizeof(msg)); if (ret < 0)