Skip to content

Commit bc15bec

Browse files
tititiou36teigland
authored andcommitted
fs: dlm: Remove some useless memset()
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 <christophe.jaillet@wanadoo.fr> Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent b859e01 commit bc15bec

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

fs/dlm/debug_fs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,6 @@ void dlm_create_debug_file(struct dlm_ls *ls)
986986

987987
/* format 2 */
988988

989-
memset(name, 0, sizeof(name));
990989
snprintf(name, sizeof(name), "%s_locks", ls->ls_name);
991990

992991
ls->ls_debug_locks_dentry = debugfs_create_file(name,
@@ -997,7 +996,6 @@ void dlm_create_debug_file(struct dlm_ls *ls)
997996

998997
/* format 3 */
999998

1000-
memset(name, 0, sizeof(name));
1001999
snprintf(name, sizeof(name), "%s_all", ls->ls_name);
10021000

10031001
ls->ls_debug_all_dentry = debugfs_create_file(name,
@@ -1008,7 +1006,6 @@ void dlm_create_debug_file(struct dlm_ls *ls)
10081006

10091007
/* format 4 */
10101008

1011-
memset(name, 0, sizeof(name));
10121009
snprintf(name, sizeof(name), "%s_toss", ls->ls_name);
10131010

10141011
ls->ls_debug_toss_dentry = debugfs_create_file(name,
@@ -1017,7 +1014,6 @@ void dlm_create_debug_file(struct dlm_ls *ls)
10171014
ls,
10181015
&format4_fops);
10191016

1020-
memset(name, 0, sizeof(name));
10211017
snprintf(name, sizeof(name), "%s_waiters", ls->ls_name);
10221018

10231019
ls->ls_debug_waiters_dentry = debugfs_create_file(name,
@@ -1028,7 +1024,6 @@ void dlm_create_debug_file(struct dlm_ls *ls)
10281024

10291025
/* format 5 */
10301026

1031-
memset(name, 0, sizeof(name));
10321027
snprintf(name, sizeof(name), "%s_queued_asts", ls->ls_name);
10331028

10341029
ls->ls_debug_queued_asts_dentry = debugfs_create_file(name,

0 commit comments

Comments
 (0)