mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv: fix MISRA-C issues related to for loop
This patch fixes the following issues: - Assignment operation in expression. - For loop incrementation is not simple. - No brackets to loop body. - Use of comma operator. v1 -> v2: * Replace &x->y with &(x->y) based on our new coding rule Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -35,7 +35,8 @@ void smp_call_function(uint64_t mask, smp_call_func_t func, void *data)
|
||||
|
||||
/* wait for previous smp call complete, which may run on other cpus */
|
||||
while (atomic_cmpxchg64(&smp_call_mask, 0UL, mask & INVALID_BIT_INDEX));
|
||||
while ((pcpu_id = ffs64(mask)) != INVALID_BIT_INDEX) {
|
||||
pcpu_id = ffs64(mask);
|
||||
while (pcpu_id != INVALID_BIT_INDEX) {
|
||||
bitmap_clear_nolock(pcpu_id, &mask);
|
||||
if (bitmap_test(pcpu_id, &pcpu_active_bitmap)) {
|
||||
smp_call = &per_cpu(smp_call_info, pcpu_id);
|
||||
@@ -46,6 +47,7 @@ void smp_call_function(uint64_t mask, smp_call_func_t func, void *data)
|
||||
pr_err("pcpu_id %d not in active!", pcpu_id);
|
||||
bitmap_clear_nolock(pcpu_id, &smp_call_mask);
|
||||
}
|
||||
pcpu_id = ffs64(mask);
|
||||
}
|
||||
send_dest_ipi(smp_call_mask, VECTOR_NOTIFY_VCPU,
|
||||
INTR_LAPIC_ICR_LOGICAL);
|
||||
|
||||
Reference in New Issue
Block a user