Patchwork net,bonding: Add return statement in bond_create_proc_entry.

login
register
mail settings
Submitter Rakib Mullick
Date Oct. 10, 2009, 2:10 a.m.
Message ID <b9df5fa10910091910u1b6bf14bg2781cb12c58b21f9@mail.gmail.com>
Download mbox | patch
Permalink /patch/35660/
State Accepted
Delegated to: David Miller
Headers show

Comments

Rakib Mullick - Oct. 10, 2009, 2:10 a.m.
The function bond_create_proc_entry supposed to return int instead of void.
And fixes the following compilation 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

---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--
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
Nicolas de Peslo√ľan - Oct. 10, 2009, 7:19 p.m.
Rakib Mullick wrote:
> The function bond_create_proc_entry supposed to return int instead of void.
> And fixes the following compilation 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
> 
> ---
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> 
> --- linus/drivers/net/bonding/bond_main.c	2009-10-09 17:38:35.000000000 +0600
> +++ rakib/drivers/net/bonding/bond_main.c	2009-10-09 17:47:46.000000000 +0600
> @@ -3391,6 +3391,7 @@ static void bond_destroy_proc_dir(void)
> 
>  static int bond_create_proc_entry(struct bonding *bond)
>  {
> +	return 0;
>  }

This empty function is defined inside the else branch of an ifdef. The corresponding non-empty 
function always return 0 and no caller of this function use the returned value.

So I suggest to change the return type of this function from int to void, instead of adding a return 
0 into the empty one.

	Nicolas.

--
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

Patch

--- linus/drivers/net/bonding/bond_main.c	2009-10-09 17:38:35.000000000 +0600
+++ rakib/drivers/net/bonding/bond_main.c	2009-10-09 17:47:46.000000000 +0600
@@ -3391,6 +3391,7 @@  static void bond_destroy_proc_dir(void)

 static int bond_create_proc_entry(struct bonding *bond)
 {
+	return 0;
 }

 static void bond_remove_proc_entry(struct bonding *bond)