diff mbox

[netnext-2.6] bonding: change bond_create_proc_entry() to return void

Message ID 1255207307-5976-1-git-send-email-nicolas.2p.debian@free.fr
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas de Pesloüan Oct. 10, 2009, 8:41 p.m. UTC
The function bond_create_proc_entry is currently of type int.

Two versions of this function exist:

The one in the ifdef CONFIG_PROC_FS branch always return 0.
The one in the else branch (which is empty) return nothing.

When CONFIG_PROC_FS is undef, this cause the following warning:

drivers/net/bonding/bond_main.c: In function `bond_create_proc_entry':
drivers/net/bonding/bond_main.c:3393: warning: control reaches end of
non-void function

No caller of this function use the returned value.

So change the returned type from int to void and remove the
useless return 0; .

Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Reported-by: Rakib Mullick <rakib.mullick@gmail.com>
---
 drivers/net/bonding/bond_main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Comments

David Miller Oct. 13, 2009, 7:45 a.m. UTC | #1
From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Date: Sat, 10 Oct 2009 22:41:47 +0200

> The function bond_create_proc_entry is currently of type int.
> 
> Two versions of this function exist:
> 
> The one in the ifdef CONFIG_PROC_FS branch always return 0.
> The one in the else branch (which is empty) return nothing.
> 
> When CONFIG_PROC_FS is undef, this cause the following warning:
> 
> drivers/net/bonding/bond_main.c: In function `bond_create_proc_entry':
> drivers/net/bonding/bond_main.c:3393: warning: control reaches end of
> non-void function
> 
> No caller of this function use the returned value.
> 
> So change the returned type from int to void and remove the
> useless return 0; .
> 
> Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
> Reported-by: Rakib Mullick <rakib.mullick@gmail.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ef6af1c..feb03ad 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3375,7 +3375,7 @@  static const struct file_operations bond_info_fops = {
 	.release = seq_release,
 };
 
-static int bond_create_proc_entry(struct bonding *bond)
+static void bond_create_proc_entry(struct bonding *bond)
 {
 	struct net_device *bond_dev = bond->dev;
 
@@ -3390,8 +3390,6 @@  static int bond_create_proc_entry(struct bonding *bond)
 		else
 			memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
 	}
-
-	return 0;
 }
 
 static void bond_remove_proc_entry(struct bonding *bond)
@@ -3430,7 +3428,7 @@  static void bond_destroy_proc_dir(void)
 
 #else /* !CONFIG_PROC_FS */
 
-static int bond_create_proc_entry(struct bonding *bond)
+static void bond_create_proc_entry(struct bonding *bond)
 {
 }