Re: [PATCH v2 5/9] drivers: net: Put prototype declaration forfunction sbni_probe() in sbni.c

From: David Miller
Date: Sat Dec 14 2013 - 22:27:13 EST


From: Rashika Kheria <rashika.kheria@xxxxxxxxx>
Date: Sat, 14 Dec 2013 17:55:42 +0530

> This patch declares the prototype for the function sbni_probe() in file sbni.c.
>
> Thus, it also removes the following warning in wan/sbni.c:
> drivers/net/wan/sbni.c:224:12: warning: no previous prototype for ʽsbni_probeʼ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <rashika.kheria@xxxxxxxxx>
> ---
>
> This revision fixes the following issues of the previous revision:
> Incorrect fix
>
> drivers/net/wan/sbni.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
> index 388ddf6..5061ffd 100644
> --- a/drivers/net/wan/sbni.c
> +++ b/drivers/net/wan/sbni.c
> @@ -221,6 +221,7 @@ static void __init sbni_devsetup(struct net_device *dev)
> dev->netdev_ops = &sbni_netdev_ops;
> }
>
> +int __init sbni_probe(int unit);
> int __init sbni_probe(int unit)

This is not the correct way to fix this kind of warning, an exported
function needs to appear in a header file so that both the definition
and any callers of this function will see the same declaration in that
header file.
θΊ{.nΗ+?·???­?+%?Λlzwm?ιb?맲ζμrΈ?zX§»?w??{ayΊΚ?Ϊ?λ,j­ʼf£ʼ·h??ΰzΉ?w?ʼΈ ʼ·¦j:+v?¨?wθjΨmΆ??Ύ«?κηzZ+?ω???έʼj"?ϊ!ΆiO?ζ¬z·?vΨ^Άm§?πΓ nΖ?ΰώY&?