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:
Shiqing Gao
2018-08-24 11:21:20 +08:00
committed by wenlingz
parent 852f613fe3
commit 10c64a5fca
6 changed files with 23 additions and 14 deletions

View File

@@ -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);