Until now, even if use DATA_TYPE_BOOLEN, use 'int' variable type.
It might cause the unknown issue by mismatched type casting
on get_property() fucntion. In order to prevent the wrong type casting,
replace with bool data type instead of integer type.
Change-Id: I51791d72579afc97b73b6a67d9a9711c21c033f4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
struct pass_scenario *scenario)
{
char name[BUFF_MAX] = {};
- int support;
+ bool support;
int target_level;
int cpuhp_min_level;
int cpuhp_max_level;
int temp_end;
int threshold;
int timer_interval_ms;
- int overridable;
+ bool overridable;
int ret = 0;
/* Get property values */
/* Initialize config_data from property values of confiugartion file */
snprintf(scenario->name, NAME_MAX, "%s", name);
- scenario->state = (support < 0) ? 1 : support;
+ scenario->state = support;
scenario->level = target_level;
/* - property for only pmqos module */
scenario->thermal.temp_end = temp_end;
scenario->thermal.threshold = threshold;
scenario->thermal.timer_interval = timer_interval_ms;
- scenario->thermal.overridable = (overridable < 0) ? 1 : overridable;
+ scenario->thermal.overridable = overridable;
return 0;
}
*/
static int parse_header(struct pass_resource *res, json_object *obj)
{
- int support;
+ bool support;
int init_level;
json_object *level_list = NULL;
int num_levels = 0, ret = 0, i;
{
char name[BUFF_MAX] = {};
int max_duration_ms;
- int support;
+ bool support;
int ret = 0;
/* Get property values */
/* Initialize config_data from property values of confiugartion file */
snprintf(scenario->name, strlen(name) + 1, "%s", name);
scenario->max_duration_ms = (max_duration_ms < 0) ? 0 : max_duration_ms;
- scenario->support = (support < 0) ? 1 : support;
+ scenario->support = support;
return 0;
}
*/
static int pmqos_load_config(json_object *obj, struct pmqos_scenario *scenarios)
{
- int pmqos_support;
+ bool pmqos_support;
json_object *pmqos_scenario_list = NULL;
int num_scenarios = 0, ret, i;
}
/* Check the validation of property value */
- if (pmqos_support <= 0 || num_scenarios <= 0) {
+ if (!pmqos_support || num_scenarios <= 0) {
_I("Disable PMQOS module\n");
return 0;
}
static int thermal_parse_scenario(json_object *obj, struct scenario *scenario)
{
char name[BUFF_MAX] = {};
- int support;
+ bool support;
int ret = 0;
/* Get property values */
/* Initialize config_data from property values of confiugartion file */
snprintf(scenario->name, strlen(name) + 1, "%s", name);
- scenario->support = (support < 0) ? 1 : support;
+ scenario->support = support;
return 0;
}
*/
static int thermal_load_config(json_object *obj, struct thermal_scenario *scenarios)
{
- int thermal_support;
+ bool thermal_support;
json_object *thermal_scenario_list = NULL;
int num_scenarios = 0, ret = 0, i;
}
/* Check the validation of property value */
- if (thermal_support <= 0 || num_scenarios <= 0) {
+ if (!thermal_support || num_scenarios <= 0) {
_I("Disable thermal module\n");
return 0;
}