Skip to content

Commit

Permalink
orangefs: fix build warning from debugfs cleanup patch
Browse files Browse the repository at this point in the history
Stephen writes:
	After merging the driver-core tree, today's linux-next build (x86_64
	allmodconfig) produced this warning:

	fs/orangefs/orangefs-debugfs.c: In function 'orangefs_debugfs_init':
	fs/orangefs/orangefs-debugfs.c:193:1: warning: label 'out' defined but not used [-Wunused-label]
	 out:
	 ^~~
	fs/orangefs/orangefs-debugfs.c: In function 'orangefs_kernel_debug_init':
	fs/orangefs/orangefs-debugfs.c:204:17: warning: unused variable 'ret' [-Wunused-variable]
	  struct dentry *ret;
	                 ^~~
Fix this up and change the return type of the function to void as it can
not fail, which cleans up some more code and variables as well.

Cc: Mike Marshall <[email protected]>
Cc: Martin Brandenburg <[email protected]>
Cc: [email protected]
Reported-by: Stephen Rothwell <[email protected]>
Fixes: f095adb ("orangefs: no need to check return value of debugfs_create functions")
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jul 4, 2019
1 parent d71cac5 commit 0979cf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
19 changes: 4 additions & 15 deletions fs/orangefs/orangefs-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct client_debug_mask {
__u64 mask2;
};

static int orangefs_kernel_debug_init(void);
static void orangefs_kernel_debug_init(void);

static int orangefs_debug_help_open(struct inode *, struct file *);
static void *help_start(struct seq_file *, loff_t *);
Expand Down Expand Up @@ -150,10 +150,8 @@ static DEFINE_MUTEX(orangefs_help_file_lock);
* initialize kmod debug operations, create orangefs debugfs dir and
* ORANGEFS_KMOD_DEBUG_HELP_FILE.
*/
int orangefs_debugfs_init(int debug_mask)
void orangefs_debugfs_init(int debug_mask)
{
int rc = -ENOMEM;

/* convert input debug mask to a 64-bit unsigned integer */
orangefs_gossip_debug_mask = (unsigned long long)debug_mask;

Expand Down Expand Up @@ -188,20 +186,15 @@ int orangefs_debugfs_init(int debug_mask)

orangefs_debug_disabled = 0;

rc = orangefs_kernel_debug_init();

out:

return rc;
orangefs_kernel_debug_init();
}

/*
* initialize the kernel-debug file.
*/
static int orangefs_kernel_debug_init(void)
static void orangefs_kernel_debug_init(void)
{
int rc = -ENOMEM;
struct dentry *ret;
char *k_buffer = NULL;

gossip_debug(GOSSIP_DEBUGFS_DEBUG, "%s: start\n", __func__);
Expand All @@ -221,12 +214,8 @@ static int orangefs_kernel_debug_init(void)
debugfs_create_file(ORANGEFS_KMOD_DEBUG_FILE, 0444, debug_dir, k_buffer,
&kernel_debug_fops);

rc = 0;

out:

gossip_debug(GOSSIP_DEBUGFS_DEBUG, "%s: rc:%d:\n", __func__, rc);
return rc;
}


Expand Down
2 changes: 1 addition & 1 deletion fs/orangefs/orangefs-debugfs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 */
int orangefs_debugfs_init(int);
void orangefs_debugfs_init(int);
void orangefs_debugfs_cleanup(void);
int orangefs_prepare_debugfs_help_string(int);
int orangefs_debugfs_new_client_mask(void __user *);
Expand Down
6 changes: 1 addition & 5 deletions fs/orangefs/orangefs-mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ static int __init orangefs_init(void)
if (ret)
goto cleanup_key_table;

ret = orangefs_debugfs_init(module_parm_debug_mask);
if (ret)
goto debugfs_init_failed;
orangefs_debugfs_init(module_parm_debug_mask);

ret = orangefs_sysfs_init();
if (ret)
Expand Down Expand Up @@ -161,8 +159,6 @@ static int __init orangefs_init(void)
orangefs_dev_cleanup();

sysfs_init_failed:

debugfs_init_failed:
orangefs_debugfs_cleanup();

cleanup_key_table:
Expand Down

0 comments on commit 0979cf9

Please sign in to comment.