hv:unify spin_lock initialization

will follow this convention for spin lock initialization:
-- for simple global variable locks, use this style:
   static spinlock_t xxx_spinlock = {.head = 0U, .tail = 0U,}
-- for the locks inside a data structure, need to call
   spinlock_init to initialize.

Tracked-On: #4958
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi
2020-07-01 09:25:49 +08:00
committed by wenlingz
parent 7b32fce06f
commit 7751c7933d
2 changed files with 2 additions and 5 deletions

View File

@@ -19,7 +19,7 @@
#define PTIRQ_BITMAP_ARRAY_SIZE INT_DIV_ROUNDUP(CONFIG_MAX_PT_IRQ_ENTRIES, 64U)
struct ptirq_remapping_info ptirq_entries[CONFIG_MAX_PT_IRQ_ENTRIES];
static uint64_t ptirq_entry_bitmaps[PTIRQ_BITMAP_ARRAY_SIZE];
spinlock_t ptdev_lock;
spinlock_t ptdev_lock = { .head = 0U, .tail = 0U, };
static struct ptirq_entry_head {
struct hlist_head list;
@@ -223,7 +223,6 @@ void ptirq_deactivate_entry(struct ptirq_remapping_info *entry)
void ptdev_init(void)
{
if (get_pcpu_id() == BSP_CPU_ID) {
spinlock_init(&ptdev_lock);
register_softirq(SOFTIRQ_PTDEV, ptirq_softirq);
}
INIT_LIST_HEAD(&get_cpu_var(softirq_dev_entry_list));