All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	BlueZ development <linux-bluetooth@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete()
Date: Mon, 20 Apr 2015 10:47:03 +0200	[thread overview]
Message-ID: <CAMuHMdUXcAYe4KCqG9wV3O5QYzK9RGt+QZz7E_jk7v9yhtrkRQ@mail.gmail.com> (raw)
In-Reply-To: <8684664B-22C2-45E8-B547-48F173B3CA7A@holtmann.org>

Hi Marcel,

On Fri, Apr 17, 2015 at 10:38 PM, Marcel Holtmann <marcel@holtmann.org> 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.
>
> I really do not know what is the best solution here. This is a false positive. And I have been looking at this particular code for a warning that was valid, but we missed initially. But these warnings that you are fixing are clearly false positive.

I only sent patches to fix false positives if I think the patches improve the
code. As this is a subjective matter, it's up to you as the maintainer to
decide.

> If this only happens with an old compiler version, I would tend to leave the code as is. Then again, what is the general preferred approach here?

As this is a false positive, it's clearly up to the maintainer to
decide if the patch
improves the code or not.

Thanks!

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

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	BlueZ development <linux-bluetooth@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete()
Date: Mon, 20 Apr 2015 10:47:03 +0200	[thread overview]
Message-ID: <CAMuHMdUXcAYe4KCqG9wV3O5QYzK9RGt+QZz7E_jk7v9yhtrkRQ@mail.gmail.com> (raw)
In-Reply-To: <8684664B-22C2-45E8-B547-48F173B3CA7A@holtmann.org>

Hi Marcel,

On Fri, Apr 17, 2015 at 10:38 PM, Marcel Holtmann <marcel@holtmann.org> wro=
te:
>>>> net/bluetooth/mgmt.c: In function =E2=80=98read_local_oob_ext_data_com=
plete=E2=80=99:
>>>> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r256=E2=80=99 may be used=
 uninitialized in this function
>>>> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h256=E2=80=99 may be used=
 uninitialized in this function
>>>> net/bluetooth/mgmt.c:6474: warning: =E2=80=98r192=E2=80=99 may be used=
 uninitialized in this function
>>>> net/bluetooth/mgmt.c:6474: warning: =E2=80=98h192=E2=80=99 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 sid=
e
>>>> effect of killing the compiler warnings.
>>>
>>> can you be a bit specific on which compiler version is this. I fixed on=
e 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 wate=
r).
>>
>> If you don't like my patch, just drop it. I only look at newly
>> introduced warnings
>> of this kind anyway.
>
> I really do not know what is the best solution here. This is a false posi=
tive. And I have been looking at this particular code for a warning that wa=
s valid, but we missed initially. But these warnings that you are fixing ar=
e clearly false positive.

I only sent patches to fix false positives if I think the patches improve t=
he
code. As this is a subjective matter, it's up to you as the maintainer to
decide.

> If this only happens with an old compiler version, I would tend to leave =
the code as is. Then again, what is the general preferred approach here?

As this is a false positive, it's clearly up to the maintainer to
decide if the patch
improves the code or not.

Thanks!

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

  reply	other threads:[~2015-04-20  8:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 19:24 [PATCH] Bluetooth: Pre-initialize variables in read_local_oob_ext_data_complete() Geert Uytterhoeven
2015-04-16 20:34 ` Marcel Holtmann
2015-04-17 20:03   ` Geert Uytterhoeven
2015-04-17 20:03     ` Geert Uytterhoeven
2015-04-17 20:03     ` Geert Uytterhoeven
2015-04-17 20:38     ` Marcel Holtmann
2015-04-17 20:38       ` Marcel Holtmann
2015-04-20  8:47       ` Geert Uytterhoeven [this message]
2015-04-20  8:47         ` Geert Uytterhoeven
2015-05-13 21:11         ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUXcAYe4KCqG9wV3O5QYzK9RGt+QZz7E_jk7v9yhtrkRQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.