diff options
author | Alexander Goncharov <chat@joursoir.net> | 2022-09-16 17:26:33 +0300 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-18 07:51:27 +0000 |
commit | ed351cc602e5f21a47ad3f06696a7fe72e82c198 (patch) | |
tree | eaf06f324da9107c9725867d9fd51bb11b0b6a51 /spi95.c | |
parent | 0f4767fd1e1eff8e20f82778e340b534af7ab190 (diff) | |
download | flashrom-ed351cc602e5f21a47ad3f06696a7fe72e82c198.tar.gz flashrom-ed351cc602e5f21a47ad3f06696a7fe72e82c198.tar.bz2 flashrom-ed351cc602e5f21a47ad3f06696a7fe72e82c198.zip |
stlinkv3_spi: work around 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 work
around 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>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67700
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'spi95.c')
0 files changed, 0 insertions, 0 deletions