Re: Fix sparse warning

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

 



On Fri, Oct 23, 2009 at 09:59:11AM +0200, Ingo Molnar wrote:
> Warnings are not something that should be 'fixed' - they are just a sign 
> of some sort of trouble:
> 
>  1- bug/limitation in the tool (Sparse)
>  2- uncleanliness in the source code
>  3- bug in the source code
> 
> here it seems to be case #1, as file scope statics are perfectly fine, 
> even if used by a single function.

This is case #2.  We used to have:

int do_one_initcall(initcall_t fn)
{
	struct boot_trace_call call;
}

static void __init do_initcalls(void)
{
        initcall_t *call;
}

static void __init do_pre_smp_initcalls(void)
{
        initcall_t *call;
}

and you changed it so that the boot_trace_call is now file-scope.  Now
sparse rightfully warns about the shadow definitions in do_initcalls and
do_pre_smp_initcalls.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux