aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValdis Kletnieks <Valdis.Kletnieks@vt.edu>2015-12-22 19:36:52 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-03 14:21:27 -0800
commit5aec2e0791a5a76bec020b088a8b8a10afcfd522 (patch)
treef434f496bc5d8ebbba104c02a490925608d98a0a
parentdrivers/staging/lustre: Clean up another C warnining: set but not used (diff)
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: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/libcfs/module.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 0067e5347884..af516a29c20e 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -511,8 +511,6 @@ static const struct file_operations lnet_debugfs_file_operations = {
void lustre_insert_debugfs(struct ctl_table *table,
const struct lnet_debugfs_symlink_def *symlinks)
{
- struct dentry *entry;
-
if (lnet_debugfs_root == NULL)
lnet_debugfs_root = debugfs_create_dir("lnet", NULL);
@@ -520,15 +518,17 @@ void lustre_insert_debugfs(struct ctl_table *table,
if (IS_ERR_OR_NULL(lnet_debugfs_root))
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++)
- entry = debugfs_create_file(table->procname, table->mode,
- lnet_debugfs_root, table,
- &lnet_debugfs_file_operations);
+ debugfs_create_file(table->procname, table->mode,
+ lnet_debugfs_root, table,
+ &lnet_debugfs_file_operations);
for (; symlinks && symlinks->name; symlinks++)
- entry = debugfs_create_symlink(symlinks->name,
- lnet_debugfs_root,
- symlinks->target);
+ debugfs_create_symlink(symlinks->name, lnet_debugfs_root,
+ symlinks->target);
}
EXPORT_SYMBOL_GPL(lustre_insert_debugfs);