Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp910684rwb; Thu, 18 Aug 2022 14:43:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Fx6atldGskSkUYTbxJrUCT3ka9bN0ifandCUGkGvvk05vJVpS/SoHfoLA29DGsrOigxCv X-Received: by 2002:aa7:d508:0:b0:445:dd73:4f6f with SMTP id y8-20020aa7d508000000b00445dd734f6fmr3637785edq.231.1660859032160; Thu, 18 Aug 2022 14:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660859032; cv=none; d=google.com; s=arc-20160816; b=fjJWPdSN14jhOxBiheOvINtX37H6GjFiaycs07OT6vHulzURuvUJP3K7tf9xaUEpa1 0P2W0bfWAkzxoci4RbzNmdPqjHyi5MLN7ny9/sE0pLqdsMy2nGaq2EIFvXLShB/oa5PT KbWNOY8sazQs05wWgBLAU0ukNfOyodMhV5/Mzy+TYZOd0Jd/E7gYky/IIAMWJCNv2UpP ERCYjnEJjFU+fRMj97iz+flepw21Tnl7VByNAmUBi5AT2/G3CxVoqRO20DbaZb7vZ/I6 SFA4tGZmokR0dJeRBR27HnJJWKfANehCv5pzO8cNLNLoue75raz3Kck+/l2x97uh0xSV 28Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VRz+OBkULP1qCSrlvRrbLc16egpQ3i9fobug+30FVl4=; b=noe0nCUcDuO0gx23Iwi7AeenYej69M2VhigeBlV1U3PMdbjrBmchc3q7P8GToHwtjx 2rB2XjddDO0CzPpTcITvjziJ4WZPkSdngjhILHalZ+gYVtqkquft7tt5BeVT+xplSJZa kkuwfwfEMUU/DYEde9CKITjNjdvbsGyUIzAiPauI9TKcnVH7RNQjvRWB8ED9Wf85KwrD 4fRpoCfkwKcJ3GlecYz2ZV2wnuU5k401QuByKalnVfyFJ+IWFW+CJgVHG2GVY4KPh8Lm lmdo3P57cWAVHs7Ds9T6zr+yq/zLouZQxICmvFSfQcG0I/1gxneJSR5f5t9MA6iGfUlC AgGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=TOEEyrfR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a50fe97000000b0043d0a1ec60bsi1596226edt.393.2022.08.18.14.43.27; Thu, 18 Aug 2022 14:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=TOEEyrfR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346215AbiHRVAO (ORCPT + 99 others); Thu, 18 Aug 2022 17:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346125AbiHRU7w (ORCPT ); Thu, 18 Aug 2022 16:59:52 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD6BAD2EBD for ; Thu, 18 Aug 2022 13:59:50 -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=6bxfqLzg+o1HYtnUVYJhBNQVS7o lON7fCx/3XuZVdc0=; b=TOEEyrfRY7GHZzD3Ejjw+dpbiiaKO/PLw9P2kRv6u/i XBROQSeSsOB6XQHfqwEx4Zb856UMu5qLYqVxJi4JFZAV+b4sk4vn6mzDzaopSsro PxruF8tkejqaXdhIWoXeeymnPHru+EsB0mbJt7DLQC9ehL2dPAQ7u/JKIvQJIjLI = Received: (qmail 3959166 invoked from network); 18 Aug 2022 22:59:48 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 22:59:48 +0200 X-UD-Smtp-Session: l3s3148p1@GpgJQ4rmxa0ucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: [PATCH] s390: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 22:59:47 +0200 Message-Id: <20220818205948.6360-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- arch/s390/kernel/debug.c | 2 +- arch/s390/kernel/early.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 4331c7e6e1c0..d7a82066a638 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -250,7 +250,7 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area, rc->level = level; rc->buf_size = buf_size; rc->entry_size = sizeof(debug_entry_t) + buf_size; - strlcpy(rc->name, name, sizeof(rc->name)); + strscpy(rc->name, name, sizeof(rc->name)); memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *)); memset(rc->debugfs_entries, 0, DEBUG_MAX_VIEWS * sizeof(struct dentry *)); refcount_set(&(rc->ref_count), 0); diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 432c8c987256..6030fdd6997b 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -267,7 +267,7 @@ char __bootdata(early_command_line)[COMMAND_LINE_SIZE]; static void __init setup_boot_command_line(void) { /* copy arch command line */ - strlcpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE); + strscpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE); } static void __init check_image_bootable(void) -- 2.35.1