<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 12:27 PM, Vinícius Tinti <span dir="ltr"><<a href="mailto:viniciustinti@gmail.com" target="_blank">viniciustinti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jan 29, 2015 at 3:07 AM, Greg KH <<a href="mailto:greg@kroah.com">greg@kroah.com</a>> wrote:<br>
> On Thu, Jan 29, 2015 at 02:16:51AM -0200, Vinícius Tinti wrote:<br>
>> On Thu, Jan 29, 2015 at 2:08 AM, Greg KH <<a href="mailto:greg@kroah.com">greg@kroah.com</a>> wrote:<br>
>> > On Thu, Jan 29, 2015 at 01:48:43AM -0200, Vinícius Tinti wrote:<br>
>> >> This is a simple patch that initializes a function with NULL to avoid some<br>
>> >> compiler warnings. In such cases should I proceed as a normal patch or it is<br>
>> >> better to send to another ML like to one for trivial patches?<br>
>> >><br>
>> >> Thanks,<br>
>> >><br>
>> >> Tinti<br>
>> ><br>
>> >> >From a391789bf44afbdbe2a7b3c76301b5ece9f72475 Mon Sep 17 00:00:00 2001<br>
>> >> From: =?UTF-8?q?Vin=C3=ADcius=20Tinti?= <<a href="mailto:viniciustinti@gmail.com">viniciustinti@gmail.com</a>><br>
>> >> Date: Thu, 29 Jan 2015 01:35:34 -0200<br>
>> >> Subject: [PATCH] x86: LLVMLinux: Fix uninitialized function do_reloc<br>
>> >> MIME-Version: 1.0<br>
>> >> Content-Type: text/plain; charset=UTF-8<br>
>> >> Content-Transfer-Encoding: 8bit<br>
>> >><br>
>> >> Explicit initializes do_reloc function with NULL. Later the function is<br>
>> >> either proper initialized of an error issued.<br>
>> >><br>
>> >> Signed-off-by: Vinícius Tinti <<a href="mailto:viniciustinti@gmail.com">viniciustinti@gmail.com</a>><br>
>> >> ---<br>
>> >> arch/x86/tools/relocs.c | 2 +-<br>
>> >> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
>> >><br>
>> >> diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c<br>
>> >> index 0c2fae8..1d533f1 100644<br>
>> >> --- a/arch/x86/tools/relocs.c<br>
>> >> +++ b/arch/x86/tools/relocs.c<br>
>> >> @@ -971,7 +971,7 @@ static void emit_relocs(int as_text, int use_real_mode)<br>
>> >> int i;<br>
>> >> int (*write_reloc)(uint32_t, FILE *) = write32;<br>
>> >> int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,<br>
>> >> - const char *symname);<br>
>> >> + const char *symname) = NULL;<br>
>> ><br>
>> > I think you need to get an updated version of the compiler as this patch<br>
>> > should not be needed at all. It doesn't cause a warning here for me<br>
>> > without it.<br>
>><br>
>> In fact it causes a warning on Clang which complains that:<br>
>><br>
>> arch/x86/tools/relocs.c:977:6: warning: variable 'do_reloc' is used<br>
>> uninitialized whenever 'if' condition is false<br>
>> [-Wsometimes-uninitialized]<br>
><br>
> I suggest you file a bug with clang, gcc doesn't have this problem at<br>
> all as obviously, if you look at the code, that variable can never be<br>
> used uninitialized.<br>
<br>
</div></div>I can simply turn down this kind of warning.<br>
<span class=""><br>
>> I think there is not a problem on the current code but to avoid<br>
>> further problems I believe it is worth to initialize this function<br>
>> with NULL.<br>
>> What do you think?<br>
><br>
> Don't paper over bugs in the compiler with kernel code changes for no<br>
> good reason :)<br>
<br>
</span>Agreed. But whenever I find a warning in GCC during the build what<br>
should I do with it?<br>
Can I simply send it to the main ml?<br></blockquote><div>If you believe your patch is correct, and if <a href="http://checkpatch.pl">checkpatch.pl</a> doesn't complain about your patch, then <a href="http://get_maintainers.pl">get_maintainers.pl</a> will tell you the people and mailing lists you should send your patch to.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
> thanks,<br>
><br>
> greg k-h<br>
<br>
<br>
<br>
--<br>
Simplicity is the ultimate sophistication<br>
<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Peter</div>
</div></div>