From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbbDQUDb (ORCPT ); Fri, 17 Apr 2015 16:03:31 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:36494 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbbDQUD3 convert rfc822-to-8bit (ORCPT ); Fri, 17 Apr 2015 16:03:29 -0400 MIME-Version: 1.0 In-Reply-To: References: <1429212265-26750-1-git-send-email-geert@linux-m68k.org> Date: Fri, 17 Apr 2015 22:03:29 +0200 X-Google-Sender-Auth: jrCewOXrQwasemftDaO47Lmflts Message-ID: Subject: Re: [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete() From: Geert Uytterhoeven To: Marcel Holtmann Cc: "Gustavo F. Padovan" , Johan Hedberg , BlueZ development , netdev , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcel, On Thu, Apr 16, 2015 at 10:34 PM, Marcel Holtmann wrote: >> net/bluetooth/mgmt.c: In function ‘read_local_oob_ext_data_complete’: >> net/bluetooth/mgmt.c:6474: warning: ‘r256’ may be used uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: ‘h256’ may be used uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: ‘r192’ may be used uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: ‘h192’ may be used uninitialized in this function >> >> While these are false positives, the code can be shortened by >> pre-initializing the hash table pointers and eir_len. This has the side >> effect of killing the compiler warnings. > > can you be a bit specific on which compiler version is this. I fixed one occurrence that seemed valid. However in this case the compiler seems to be just plain stupid. On a gcc 4.9, I am not seeing these for example. gcc 4.1.2. As there were too many false positives, these warnings were disabled in later versions (throwing away the children with the bad water). If you don't like my patch, just drop it. I only look at newly introduced warnings of this kind anyway. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: Re: [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete() Date: Fri, 17 Apr 2015 22:03:29 +0200 Message-ID: References: <1429212265-26750-1-git-send-email-geert@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Gustavo F. Padovan" , Johan Hedberg , BlueZ development , netdev , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" To: Marcel Holtmann Return-path: In-Reply-To: Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org Hi Marcel, On Thu, Apr 16, 2015 at 10:34 PM, Marcel Holtmann = wrote: >> net/bluetooth/mgmt.c: In function =E2=80=98read_local_oob_ext_data_c= omplete=E2=80=99: >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r256=E2=80=99 may be us= ed uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h256=E2=80=99 may be us= ed uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r192=E2=80=99 may be us= ed uninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h192=E2=80=99 may be us= ed uninitialized in this function >> >> While these are false positives, the code can be shortened by >> pre-initializing the hash table pointers and eir_len. This has the s= ide >> effect of killing the compiler warnings. > > can you be a bit specific on which compiler version is this. I fixed = one occurrence that seemed valid. However in this case the compiler see= ms to be just plain stupid. On a gcc 4.9, I am not seeing these for exa= mple. gcc 4.1.2. As there were too many false positives, these warnings were disabled in later versions (throwing away the children with the bad wat= er). If you don't like my patch, just drop it. I only look at newly introduced warnings of this kind anyway. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-= m68k.org In personal conversations with technical people, I call myself a hacker= =2E But when I'm talking to journalists I just say "programmer" or something li= ke that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 Sender: geert.uytterhoeven@gmail.com In-Reply-To: References: <1429212265-26750-1-git-send-email-geert@linux-m68k.org> Date: Fri, 17 Apr 2015 22:03:29 +0200 Message-ID: Subject: Re: [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete() From: Geert Uytterhoeven To: Marcel Holtmann Cc: "Gustavo F. Padovan" , Johan Hedberg , BlueZ development , netdev , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 List-ID: Hi Marcel, On Thu, Apr 16, 2015 at 10:34 PM, Marcel Holtmann wro= te: >> net/bluetooth/mgmt.c: In function =E2=80=98read_local_oob_ext_data_compl= ete=E2=80=99: >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r256=E2=80=99 may be used u= ninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h256=E2=80=99 may be used u= ninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r192=E2=80=99 may be used u= ninitialized in this function >> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h192=E2=80=99 may be used u= ninitialized in this function >> >> While these are false positives, the code can be shortened by >> pre-initializing the hash table pointers and eir_len. This has the side >> effect of killing the compiler warnings. > > can you be a bit specific on which compiler version is this. I fixed one = occurrence that seemed valid. However in this case the compiler seems to be= just plain stupid. On a gcc 4.9, I am not seeing these for example. gcc 4.1.2. As there were too many false positives, these warnings were disabled in later versions (throwing away the children with the bad water). If you don't like my patch, just drop it. I only look at newly introduced warnings of this kind anyway. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds