pass: rescon: Fix wrong initial value to distinguish either property is added or not 55/262155/1
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 2 Aug 2021 10:09:40 +0000 (19:09 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 3 Aug 2021 06:15:15 +0000 (15:15 +0900)
The commit d54cf9cc4588 ("pass: rescon: Add support for multiple
scenario pass_level") has defined the MIN_INT (zeor) to inialize
the property values in struct pass_level. But, some property values
will have the zero value like cooling_device_state is zero.
In that case, if MIN_INT is zero, cannot separate the following two
cases:
- propery is absence in configuration file -> 0
- property value is zero in configuration file -> 0

In order to separate the above two cases, change the MIN_INT value
from 0 to -1. After changes, can separate the two cases as following:
- propery is absence in configuration file -> -1
- property value is zero in configuration file -> 0

Change-Id: I2ee3fe9372c2deb82018949fc2b4b85eb3bb96ff
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-rescon.c

index 79d3a1acc360cd46ec709db04c904cb6cc883694..0d96475727ea92a0ed2cc5692e19f972e244c160 100644 (file)
@@ -34,7 +34,7 @@
 #include "pass-hal.h"
 
 #define MAX_INT                                1000000000
-#define MIN_INT                                0
+#define MIN_INT                                -1
 #define MIN_FAULT_AROUND_BYTES         4096
 #define MAX_FAULT_AROUND_BYTES         65536