char *res_name;
int res_type;
- if (!res)
+ if (!res || !governor)
return -EINVAL;
res_name = res->cdata.res_name;
char *res_name;
int res_type;
- if (!res)
+ if (!res || cpu < 0)
return -EINVAL;
res_name = res->cdata.res_name;
char *res_name;
int res_type;
- if (!res || on < 0)
+ if (!res || cpu < 0 || on < 0)
return -EINVAL;
res_name = res->cdata.res_name;
char *res_thermal_name;
int res_type;
- if (!res)
+ if (!res || !policy)
return -EINVAL;
/*
int pass_get_resource(struct pass_resource *res)
{
- struct pass_conf_data *cdata = &res->cdata;
+ struct pass_conf_data *cdata;
struct pass_resource_info *info;
- char *res_name = cdata->res_name;
+ char *res_name;
char name[BUFF_MAX];
- int res_type = cdata->res_type;
+ int res_type;
int ret;
int len;
+ if (!res)
+ return -EINVAL;
+ cdata = &res->cdata;
+ res_name = cdata->res_name;
+ res_type = cdata->res_type;
+
switch (res_type) {
case PASS_RESOURCE_CPU_ID:
len = strlen(PASS_RESOURCE_CPU_NAME);
int pass_put_resource(struct pass_resource *res)
{
- struct pass_conf_data *cdata = &res->cdata;
+ struct pass_conf_data *cdata;
struct pass_resource_common *common;
struct pass_resource_info *info;
- char *res_name = cdata->res_name;
- int res_type = cdata->res_type;
+ char *res_name;
+ int res_type;
int ret;
+ if (!res)
+ return -EINVAL;
+ cdata = &res->cdata;
+ res_name = cdata->res_name;
+ res_type = cdata->res_type;
+
switch (res_type) {
case PASS_RESOURCE_CPU_ID:
common = (struct pass_resource_common*)res->hal.cpu;