mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-02 16:30:12 +00:00
hv: cpu: remove unnecessary cpu_id valid check
Remove unnecessary cpu_id valid check if the cpu_id comes from get_cpu_id(). Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
parent
a98113bfce
commit
8f39a22961
@ -114,10 +114,6 @@ static int request_timer_irq(uint16_t pcpu_id,
|
||||
{
|
||||
struct dev_handler_node *node = NULL;
|
||||
|
||||
if (pcpu_id >= phys_cpu_num) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (per_cpu(timer_node, pcpu_id) != NULL) {
|
||||
pr_err("CPU%d timer isr already added", pcpu_id);
|
||||
unregister_handler_common(per_cpu(timer_node, pcpu_id));
|
||||
|
@ -123,12 +123,6 @@ int32_t hv_main(uint16_t pcpu_id)
|
||||
pr_info("%s, Starting common entry point for CPU %hu",
|
||||
__func__, pcpu_id);
|
||||
|
||||
if (pcpu_id >= phys_cpu_num) {
|
||||
pr_err("%s, cpu_id %hu out of range %d\n",
|
||||
__func__, pcpu_id, phys_cpu_num);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (pcpu_id != get_cpu_id()) {
|
||||
pr_err("%s, cpu_id %hu mismatch\n", __func__, pcpu_id);
|
||||
return -EINVAL;
|
||||
|
@ -408,7 +408,10 @@ void stop_cpus();
|
||||
CPU_RFLAGS_RESTORE(cpu_int_value); \
|
||||
}
|
||||
|
||||
/* Macro to get CPU ID */
|
||||
/*
|
||||
* Macro to get CPU ID
|
||||
* @pre: the return CPU ID would never equal or large than phys_cpu_num.
|
||||
*/
|
||||
static inline uint16_t get_cpu_id(void)
|
||||
{
|
||||
uint32_t tsl, tsh, cpu_id;
|
||||
|
@ -78,10 +78,6 @@ struct trace_entry {
|
||||
static inline bool
|
||||
trace_check(uint16_t cpu_id, __unused uint32_t evid)
|
||||
{
|
||||
if (cpu_id >= phys_cpu_num) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (per_cpu(sbuf, cpu_id)[ACRN_TRACE] == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user