diff options
author | Julius Werner <jwerner@chromium.org> | 2021-02-24 16:41:55 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2021-02-26 00:49:35 +0000 |
commit | 7f0d3de251f60dd71f48f87457c3057ec7a71148 (patch) | |
tree | 126e1b0b2592ba79eed3b4f8a5987523b296db7c /src/mainboard/google/butterfly/ec.h | |
parent | 6e3f38392720bbedd0d493ec61c9d211a36670a8 (diff) |
rk3399: sdram: Remove obs_err variable to avoid uninitialized use
CB:50863 refactored the data_training() function to split out read gate
training into a separate function, but in the course of this forgot to
correctly initialize the local obs_err varible in the new function to 0.
This means that it will be used uninitialized, and when it happens to be
non-zero it makes the training process fail. Due to the convoluted
control flow in the function, it seems that GCC's static analyzer
couldn't pick up on this uninitialized use.
The whole variable is unnecessary anyway, all it's used for is to force
the function to return two lines below without doing anything with
side-effects in between. This patch removes the variable and simplifies
the code in all three training functions to avoid this uninitialized use
issue and make everything a bit more readable. (Also restore the
original pre-clang-format continuation line intendations for more
readability.)
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ia475d64c06f2ec1bf9295742d173ce66717b821c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51079
Reviewed-by: Moritz Fischer <moritzf@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/butterfly/ec.h')
0 files changed, 0 insertions, 0 deletions