Now the lcore ID has been verified in framework API, so remove the verification in driver.
Signed-off-by: Huisong Li <[email protected]> --- drivers/power/cppc/cppc_cpufreq.c | 65 ------------------------------- 1 file changed, 65 deletions(-) diff --git a/drivers/power/cppc/cppc_cpufreq.c b/drivers/power/cppc/cppc_cpufreq.c index 7e1298110a..529f68e574 100644 --- a/drivers/power/cppc/cppc_cpufreq.c +++ b/drivers/power/cppc/cppc_cpufreq.c @@ -346,11 +346,6 @@ power_cppc_cpufreq_init(unsigned int lcore_id) return -1; } - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; exp_state = POWER_IDLE; /* The power in use state works as a guard variable between @@ -428,11 +423,6 @@ power_cppc_cpufreq_exit(unsigned int lcore_id) struct cppc_power_info *pi; uint32_t exp_state; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; exp_state = POWER_USED; /* The power in use state works as a guard variable between @@ -478,11 +468,6 @@ power_cppc_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return 0; - } - if (freqs == NULL) { POWER_LOG(ERR, "NULL buffer supplied"); return 0; @@ -501,22 +486,12 @@ power_cppc_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num) uint32_t power_cppc_cpufreq_get_freq(unsigned int lcore_id) { - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return RTE_POWER_INVALID_FREQ_INDEX; - } - return lcore_power_info[lcore_id].curr_idx; } int power_cppc_cpufreq_set_freq(unsigned int lcore_id, uint32_t index) { - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - return set_freq_internal(&(lcore_power_info[lcore_id]), index); } @@ -525,11 +500,6 @@ power_cppc_cpufreq_freq_down(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; if (pi->curr_idx + 1 == pi->nb_freqs) return 0; @@ -543,11 +513,6 @@ power_cppc_cpufreq_freq_up(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; if (pi->curr_idx == 0 || (pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable)) @@ -560,11 +525,6 @@ power_cppc_cpufreq_freq_up(unsigned int lcore_id) int power_cppc_cpufreq_freq_max(unsigned int lcore_id) { - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - /* Frequencies in the array are from high to low. */ if (lcore_power_info[lcore_id].turbo_available) { if (lcore_power_info[lcore_id].turbo_enable) @@ -584,11 +544,6 @@ power_cppc_cpufreq_freq_min(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; /* Frequencies in the array are from high to low. */ @@ -600,11 +555,6 @@ power_cppc_turbo_status(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; return pi->turbo_enable; @@ -615,11 +565,6 @@ power_cppc_enable_turbo(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; if (pi->turbo_available) @@ -651,11 +596,6 @@ power_cppc_disable_turbo(unsigned int lcore_id) { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - pi = &lcore_power_info[lcore_id]; pi->turbo_enable = 0; @@ -679,11 +619,6 @@ power_cppc_get_capabilities(unsigned int lcore_id, { struct cppc_power_info *pi; - if (!rte_lcore_is_eal_managed(lcore_id)) { - POWER_LOG(ERR, "lcore id %u is invalid.", lcore_id); - return -1; - } - if (caps == NULL) { POWER_LOG(ERR, "Invalid argument"); return -1; -- 2.33.0

