#include "config-parser.h"
-#define MAX_LINE 128
+#define BUFF_MAX 255
#define MAX_SECTION 64
#define WHITESPACE " \t"
#define NEWLINE "\n\r"
FILE *f = NULL;
struct parse_result result;
/* use stack for parsing */
- char line[MAX_LINE];
+ char line[BUFF_MAX];
char section[MAX_SECTION];
char *start, *end, *name, *value;
int lineno = 0, ret = 0;
}
/* parsing line by line */
- while (fgets(line, MAX_LINE, f) != NULL) {
+ while (fgets(line, BUFF_MAX, f) != NULL) {
lineno++;
start = line;
#include "core/config-parser.h"
#include "hal/hal.h"
-#define BUFF_MAX 255
#define MAX_NUM 255
#define MIN_TIMEOUT_SEC 0.2
/* Parse 'Scenario' section */
if (MATCH(result->name, "name")) {
- snprintf(pmqos->scenarios[index].name, PASS_NAME_LEN, "%s",
+ snprintf(pmqos->scenarios[index].name, BUFF_MAX, "%s",
result->value);
} else if (MATCH(result->name, "support")) {
pmqos->scenarios[index].state = is_supported(result->value);
else
return -EINVAL;
} else if (MATCH(result->name, "pass_res_name")) {
- snprintf(conf_data->res_name, PASS_NAME_LEN, "%s", result->value);
+ snprintf(conf_data->res_name, BUFF_MAX, "%s", result->value);
} else if (MATCH(result->name, "pass_res_thermal_name")) {
- snprintf(conf_data->res_thermal_name, PASS_NAME_LEN, "%s", result->value);
+ snprintf(conf_data->res_thermal_name, BUFF_MAX, "%s", result->value);
} else if (MATCH(result->name, "pass_path_conf_file")) {
- snprintf(conf_data->path_conf_file, PASS_NAME_LEN, "%s", result->value);
+ snprintf(conf_data->path_conf_file, BUFF_MAX, "%s", result->value);
} else if (MATCH(result->name, "pass_path_load_table")) {
- snprintf(conf_data->path_load_table, PASS_NAME_LEN, "%s", result->value);
+ snprintf(conf_data->path_load_table, BUFF_MAX, "%s", result->value);
} else if (MATCH(result->name, "pass_first_cpu")) {
int res_type = conf_data->res_type;
struct pass_pmqos *pmqos;
struct pass_scenario *scn = NULL;
enum pass_state locked = PASS_UNUSED;
- char name[PASS_NAME_LEN] = {""};
+ char name[BUFF_MAX] = {""};
unsigned int new_level = 0;
unsigned int min_level = 0;
unsigned int max_level = 0;
#include "shared/log.h"
+#define BUFF_MAX 255
+
/******************************************************
* PASS Governors *
******************************************************/
-#define PASS_NAME_LEN 128
#define PASS_LEVEL_COND_MAX 3
struct pass_policy;
* @sequence: the sequence to turn on/off cpu
*/
struct pass_hotplug {
- char name[PASS_NAME_LEN];
+ char name[BUFF_MAX];
unsigned int num_cpus;
unsigned int online;
unsigned int *sequence;
};
struct pass_scenario {
- char name[PASS_NAME_LEN];
+ char name[BUFF_MAX];
enum pass_state state;
enum pass_state locked;
int64_t locked_time;
*/
struct pass_conf_data {
unsigned int res_type;
- char res_name[PASS_NAME_LEN];
- char res_thermal_name[PASS_NAME_LEN];
- char path_conf_file[PASS_NAME_LEN];
- char path_load_table[PASS_NAME_LEN];
+ char res_name[BUFF_MAX];
+ char res_thermal_name[BUFF_MAX];
+ char path_conf_file[BUFF_MAX];
+ char path_load_table[BUFF_MAX];
unsigned int num_cpus;
unsigned int cpu;