From patchwork Fri Sep 22 17:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 143631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5831453vqi; Fri, 22 Sep 2023 12:56:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEH/pCLzhXKxSzEnNHwb6J1JX4KAfSyB1Wa7TYK7K7Mlh2LSVuhfMb2vKPAeV0p1UlN98YU X-Received: by 2002:a05:6a00:13a0:b0:690:c75e:25d7 with SMTP id t32-20020a056a0013a000b00690c75e25d7mr423553pfg.18.1695412586159; Fri, 22 Sep 2023 12:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695412586; cv=none; d=google.com; s=arc-20160816; b=y1o7b08ajg4X4rsYoV06Z8Rh8O7VRRiRBIuAxRs8fuRbReZrydOxmZ3g3bbOf/uX4c 2224i2V2lu+3jdNXvbaWWQPRdWSQzUf2Z64ryx+nDFcm+PLIoi33iw6kKeWsgT9/AZV3 zffn5zD1C24KvEgy2kEIkx7/Ycdd8pCqEarpCliZbedSuz/50M8OAttRQC1URF6iyoV9 fla24H9s1GEVn8LIoka3/mZDjBpmaGhBJ4VbOXtgInfAdvIVJswy1ySbS1x1rzoz5h+w vi20u4KLPdC4n6gdcqYe8P5Q/AdjLHjySNy5JBhrDueOoXtMRLKfXCfoJ+y8DKCpwiqB +MXw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V2TWwOebnSbbI2cNxOy+6tSiLTe5TgHaacu+uy4XtWI=; fh=5d5DzgLQCEotuv+RjGWAyxY8dXgdXesvIaUFZnqx0hw=; b=KRKjZUzWD0LIsDrITNM28SKiLFtluDJidjms5Z4EEGPXxKvpW2HhlpErmz2SSyUsqW BLbMe+jyoTHfqFRaKn1ocuDHOOVdixVUqwfpLQOTt2/87wLkcb6A/b5g8IbxfrgELPE/ 6w31UOKQJ/bJ07MDEzjiajHaTjB+Ck8E5OnSEquisgZ/f7/DZ4s3lIT/Sf9+DKG14zc/ H27zHNSb4HMI8H7wwVbjxsnz7UsGhnsE5u7/ouW6ttdb9qlO3+fIRAS4OeSV6ee4zHV/ 5s5coRMMUw2612iR7y6jxGXmQALV6OV1BsxUpIebveMIkYHJfJcvZZklZbYDObpU06x9 hB2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=TX6zHgc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q17-20020a056a00085100b0068bc3b540b0si4528352pfk.390.2023.09.22.12.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 12:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=TX6zHgc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B168E82AB449; Fri, 22 Sep 2023 10:32:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233394AbjIVRcX (ORCPT + 28 others); Fri, 22 Sep 2023 13:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbjIVRcC (ORCPT ); Fri, 22 Sep 2023 13:32:02 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F360394 for ; Fri, 22 Sep 2023 10:31:23 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id jjzlq1mvsWkeLjjzuquw1D; Fri, 22 Sep 2023 19:31:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1695403882; bh=V2TWwOebnSbbI2cNxOy+6tSiLTe5TgHaacu+uy4XtWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TX6zHgc928K0ZEdheeOI3LHvylT2Zk+3802M3kwf7zwKf6/tNyJV2hrS0t2QDL6zm y17PxnNEsUNJtz3rB4eIs7+J97GsfmCA5+4lBwF2d1XL7JZbnoVE985mg3NYAV3t+/ 9fGYZmwB3YwvOiUCg5Kb92t+mxWukCCCsdjVOYTFaGW2kf1SREFy6d3ijUqqWHXqrO fkdgUd3NCgOn25vktljueaiheiiN3VPmdctVP4ZnkyEo1uD/d3ouUbWfKkKBEoi/iK 7V/JJcmQnD/sTem8fmoMZoRPACWoB/qCD1N2bdsXQ3rj76jI5VJh3Hczk85olXLvOa 1mAMhDtGfhbdg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 22 Sep 2023 19:31:22 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Christine Caulfield , David Teigland Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , gfs2@lists.linux.dev Subject: [PATCH 3/3] fs: dlm: Remove some useless memset() Date: Fri, 22 Sep 2023 19:31:10 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 10:32:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777768948054641136 X-GMAIL-MSGID: 1777768948054641136 There is no need to clear the buffer used to build the file name. snprintf() already guarantees that it is NULL terminated and such a (useless) precaution was not done for the first string (i.e ls_debug_rsb_dentry) So, save a few LoC. Signed-off-by: Christophe JAILLET --- fs/dlm/debug_fs.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index c93359ceaae6..42f332f46359 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c @@ -986,7 +986,6 @@ void dlm_create_debug_file(struct dlm_ls *ls) /* format 2 */ - memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "%s_locks", ls->ls_name); ls->ls_debug_locks_dentry = debugfs_create_file(name, @@ -997,7 +996,6 @@ void dlm_create_debug_file(struct dlm_ls *ls) /* format 3 */ - memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "%s_all", ls->ls_name); ls->ls_debug_all_dentry = debugfs_create_file(name, @@ -1008,7 +1006,6 @@ void dlm_create_debug_file(struct dlm_ls *ls) /* format 4 */ - memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "%s_toss", ls->ls_name); ls->ls_debug_toss_dentry = debugfs_create_file(name, @@ -1017,7 +1014,6 @@ void dlm_create_debug_file(struct dlm_ls *ls) ls, &format4_fops); - memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "%s_waiters", ls->ls_name); ls->ls_debug_waiters_dentry = debugfs_create_file(name, @@ -1028,7 +1024,6 @@ void dlm_create_debug_file(struct dlm_ls *ls) /* format 5 */ - memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "%s_queued_asts", ls->ls_name); ls->ls_debug_queued_asts_dentry = debugfs_create_file(name,