From 87e7078407b158d9b485b2fb3cbc312d4da19731 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Mon, 24 Apr 2023 16:41:58 +0200
Subject: [PATCH] Enable rdcu parameters when using the rdcu_pkt option

Fix a bug in the parallel model update
---
 cmp_tool.c     | 1 +
 lib/cmp_rdcu.c | 2 +-
 meson.build    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cmp_tool.c b/cmp_tool.c
index 847100f..b676c67 100644
--- a/cmp_tool.c
+++ b/cmp_tool.c
@@ -225,6 +225,7 @@ int main(int argc, char **argv)
 			/* fall through */
 		case RDCU_PKT_OPTION:
 			rdcu_pkt_mode = 1;
+			add_rdcu_pars = 1;
 			/* fall through */
 		case NO_HEADER:
 			include_cmp_header = 0;
diff --git a/lib/cmp_rdcu.c b/lib/cmp_rdcu.c
index e50fee6..362cdfc 100644
--- a/lib/cmp_rdcu.c
+++ b/lib/cmp_rdcu.c
@@ -527,7 +527,7 @@ int rdcu_compress_data_parallel(const struct cmp_cfg *cfg,
 		if (cfg->icu_new_model_buf) {
 			if (rdcu_read_sram(cfg->icu_new_model_buf,
 					   last_info->rdcu_new_model_adr_used,
-					   new_model_size_4byte))
+					   new_model_size_4byte) < 0)
 				return -1;
 		}
 	/* write model */
diff --git a/meson.build b/meson.build
index 1548ca2..01cc9c9 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('cmp_tool', 'c',
-  version : '0.10-b.2',
+  version : '0.10-b.3',
   meson_version : '>= 0.56',
   license : 'GPL-2.0',
   default_options : ['warning_level=3', 'c_std=gnu99']
-- 
GitLab