Re: fs/fat - fix sparse warning

From: Adrian Bunk
Date: Wed Nov 02 2005 - 13:04:25 EST


On Mon, Oct 31, 2005 at 11:15:34PM +0900, OGAWA Hirofumi wrote:
> Ben Dooks <ben-linux@xxxxxxxxx> writes:
>
> > move fat_cache_init/fat_cache_destroy to a common
> > header file in fs/fat so that inode.c and cache.c
> > see the same definition, and to stop warnings
> > from sparse about undeclared functions
>
> The fs/fat/* has many internal functions, it is in
> include/linux/msdos_fs.h. Please move those internal functions to one
> internal header (probably fs/fat/fat.h?).
>
> This seems be just for sparse, please do real cleanup instead.

It's not only for sparse.

The -Wmissing-prototypes flag to gcc gives similar warnings, and I'm
also cleaning up code for adding this flag to the CFLAGS.

Why?

It sometimes happens that the signature of a function changes and it is
forgotten to update all prototypes.

If the prototype is in a header file, gcc tells about the mistake.

If the prototype is in the C file gcc can't help us and it might take
some time until someone tracks the source of the nasty runtime problems
this might cause.

It's your choice as subsystem maintainer which header file the
prototypes should go into - it is only important that both the file with
the actual function and all users of this function #include this header.

> OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

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