Commit 5aec2e07 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

drivers/staging/lustre: Fix another C compiler whine: set but not used

  CC [M]  drivers/staging/lustre/lustre/libcfs/module.o
drivers/staging/lustre/lustre/libcfs/module.c: In function 'lustre_insert_debugfs':
drivers/staging/lustre/lustre/libcfs/module.c:670:17: warning: variable 'entry' set but not used [-Wunused-but-set-variable]
  struct dentry *entry;
                     ^

Just ignore the dentry returned, and add a comment that we *know*
we're not really leaking the dentry because something else will be able
to reap it via recursion.
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f6ab072
...@@ -511,8 +511,6 @@ static const struct file_operations lnet_debugfs_file_operations = { ...@@ -511,8 +511,6 @@ static const struct file_operations lnet_debugfs_file_operations = {
void lustre_insert_debugfs(struct ctl_table *table, void lustre_insert_debugfs(struct ctl_table *table,
const struct lnet_debugfs_symlink_def *symlinks) const struct lnet_debugfs_symlink_def *symlinks)
{ {
struct dentry *entry;
if (lnet_debugfs_root == NULL) if (lnet_debugfs_root == NULL)
lnet_debugfs_root = debugfs_create_dir("lnet", NULL); lnet_debugfs_root = debugfs_create_dir("lnet", NULL);
...@@ -520,14 +518,16 @@ void lustre_insert_debugfs(struct ctl_table *table, ...@@ -520,14 +518,16 @@ void lustre_insert_debugfs(struct ctl_table *table,
if (IS_ERR_OR_NULL(lnet_debugfs_root)) if (IS_ERR_OR_NULL(lnet_debugfs_root))
return; return;
/* We don't save the dentry returned in next two calls, because
* we don't call debugfs_remove() but rather remove_recursive()
*/
for (; table->procname; table++) for (; table->procname; table++)
entry = debugfs_create_file(table->procname, table->mode, debugfs_create_file(table->procname, table->mode,
lnet_debugfs_root, table, lnet_debugfs_root, table,
&lnet_debugfs_file_operations); &lnet_debugfs_file_operations);
for (; symlinks && symlinks->name; symlinks++) for (; symlinks && symlinks->name; symlinks++)
entry = debugfs_create_symlink(symlinks->name, debugfs_create_symlink(symlinks->name, lnet_debugfs_root,
lnet_debugfs_root,
symlinks->target); symlinks->target);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment