Print this page
10246 fix apic_allocate_irq() indentation

@@ -20,11 +20,11 @@
  */
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2016 Nexenta Systems, Inc.
  * Copyright (c) 2017 by Delphix. All rights reserved.
- * Copyright (c) 2018, Joyent, Inc.
+ * Copyright (c) 2019, Joyent, Inc.
  */
 /*
  * Copyright (c) 2010, Intel Corporation.
  * All rights reserved.
  */

@@ -1602,11 +1602,11 @@
 int
 apic_allocate_irq(int irq)
 {
         int     freeirq, i;
 
-        if ((freeirq = apic_find_free_irq(irq, (APIC_RESV_IRQ - 1))) == -1)
+        if ((freeirq = apic_find_free_irq(irq, (APIC_RESV_IRQ - 1))) == -1) {
                 if ((freeirq = apic_find_free_irq(APIC_FIRST_FREE_IRQ,
                     (irq - 1))) == -1) {
                         /*
                          * if BIOS really defines every single irq in the mps
                          * table, then don't worry about conflicting with

@@ -1618,16 +1618,19 @@
                                     FREE_INDEX) {
                                 freeirq = i;
                                 break;
                         }
                 }
+
                 if (freeirq == -1) {
                         /* This shouldn't happen, but just in case */
                         cmn_err(CE_WARN, "%s: NO available IRQ", psm_name);
                         return (-1);
                 }
         }
+        }
+
         if (apic_irq_table[freeirq] == NULL) {
                 apic_irq_table[freeirq] =
                     kmem_zalloc(sizeof (apic_irq_t), KM_NOSLEEP);
                 if (apic_irq_table[freeirq] == NULL) {
                         cmn_err(CE_WARN, "%s: NO memory to allocate IRQ",