Re: [PATCH 05/13] net: Mark function as static in core/filter.c

From: Josh Triplett
Date: Sat Feb 08 2014 - 15:10:14 EST


On Sun, Feb 09, 2014 at 01:25:05AM +0530, Rashika Kheria wrote:
> Mark function as static in core/filter.c because it is not used outside
> this file.
>
> This eliminates the following warning in core/filter.c:
> net/core/filter.c:48:7: warning: no previous prototype for âbpf_internal_load_pointer_neg_helperâ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <rashika.kheria@xxxxxxxxx>

This function actually is used outside this file, just not from C code;
a couple of assembly files call it. (See also the comment above this
definition: "Exported for the bpf jit load helper.")

I'd suggest prototyping this function in include/linux/filter.h , unless
someone on CC has another preference.

> net/core/filter.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index ad30d62..a022dad 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -44,7 +44,8 @@
> *
> * Exported for the bpf jit load helper.
> */
> -void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, int k, unsigned int size)
> +static void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb,
> + int k, unsigned int size)
> {
> u8 *ptr = NULL;
>
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/