aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2019-12-20 23:56:08 +0100
committerTomas Vanek <vanekt@fbl.cz>2020-03-07 15:30:05 +0000
commita2e822834df52efef5e1bbcb91a6eb1afbf102db (patch)
tree0e5caf3d1daa7dfeb6cabc7f3163d6dd5bbc73f9 /src/flash/nor
parent4e981bc27c36e696dc8ace3ab4bab534564770c1 (diff)
helper/binarybuffer: fix clang static analyzer warnings
Writing bits to an uninitialized buffer generated false warnings. Zero buffers before setting them by buf_set_u32|64() (do it only if bit-by-bit copy loop is used, zeroed buffer is not necessary if a fast path write is used) Change-Id: I2f7f8ddb45b0cbd08d3e249534fc51f4b5cc6694 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5383 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/flash/nor')
-rw-r--r--src/flash/nor/jtagspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/jtagspi.c b/src/flash/nor/jtagspi.c
index a9f2dd4a..f6e311ab 100644
--- a/src/flash/nor/jtagspi.c
+++ b/src/flash/nor/jtagspi.c
@@ -59,7 +59,7 @@ static void jtagspi_set_ir(struct flash_bank *bank)
{
struct jtagspi_flash_bank *info = bank->driver_priv;
struct scan_field field;
- uint8_t buf[4];
+ uint8_t buf[4] = { 0 };
LOG_DEBUG("loading jtagspi ir");
buf_set_u32(buf, 0, info->tap->ir_length, info->ir);