Re: [PATCH] staging: lustre: linux-prim.c: fix sparse warnings about static declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Serguey,

On Mon, Dec 29, 2014 at 03:10:32AM -0800, Serguey Parkhomovsky wrote:
> Fixes the following sparse warnings:
> 
> drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c:198:1: warning: symbol 'libcfs_arch_init' was not declared. Should it be static?
> drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c:204:1: warning: symbol 'libcfs_arch_cleanup' was not declared. Should it be static?
> 
> Signed-off-by: Serguey Parkhomovsky <sergueyparkhomovsky@xxxxxxxxx>
> ---
>  drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
> index 19f405e..4fee73f 100644
> --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
> +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
> @@ -194,14 +194,12 @@ cfs_clear_sigpending(void)
>  	spin_unlock_irqrestore(&current->sighand->siglock, flags);
>  }
>  
> -int
> -libcfs_arch_init(void)
> +static int libcfs_arch_init(void)
>  {
>  	return 0;
>  }
>  
> -void
> -libcfs_arch_cleanup(void)
> +static void libcfs_arch_cleanup(void)
>  {
>  	return;
>  }

If you look at the source code just below these functions you will find:

EXPORT_SYMBOL(libcfs_arch_init);
EXPORT_SYMBOL(libcfs_arch_cleanup);

So making these static is incorrect because they are being used outside
of this file.

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

-- 
- Jeremiah Mahler
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux