Alexander Goncharov uploaded patch set #4 to this change.

View Change

stlinkv3_spi: fix false-positive compiler error

`stlinkv3_handle` is declared without an initial value. The variable
is initialized in a branch which can only be accessed if
`devs_stlinkv3_spi[0].vendor_id != 0`. Otherwise, the variable contains
a garbage value. We can consider this case as a false positive because
`devs_stlinkv3_spi` holds as a minimum one device entry (otherwise we
wouldn't need a driver).

This issue was found by setting compiler flag `-Og`, which optimizes
debugging experience, and running scan-build. So, we have to fix it
to allow the compiler to use the flag and remove the warning from the
scan-build list.

Change-Id: Ibaf25f67186724d9045ade849026782c3eac4952
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
---
M stlinkv3_spi.c
1 file changed, 24 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/00/67700/4

To view, visit change 67700. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf25f67186724d9045ade849026782c3eac4952
Gerrit-Change-Number: 67700
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Miklós Márton <martonmiklosqdev@gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Felix Singer <felixsinger@posteo.net>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-MessageType: newpatchset