@@ -362,12 +362,13 @@ static void __remove_pin_from_irq(struct mp_chip_data *data, int apic, int pin)
362
362
{
363
363
struct irq_pin_list * tmp , * entry ;
364
364
365
- list_for_each_entry_safe (entry , tmp , & data -> irq_2_pin , list )
365
+ list_for_each_entry_safe (entry , tmp , & data -> irq_2_pin , list ) {
366
366
if (entry -> apic == apic && entry -> pin == pin ) {
367
367
list_del (& entry -> list );
368
368
kfree (entry );
369
369
return ;
370
370
}
371
+ }
371
372
}
372
373
373
374
static void io_apic_modify_irq (struct mp_chip_data * data , bool masked ,
@@ -562,8 +563,7 @@ int save_ioapic_entries(void)
562
563
}
563
564
564
565
for_each_pin (apic , pin )
565
- ioapics [apic ].saved_registers [pin ] =
566
- ioapic_read_entry (apic , pin );
566
+ ioapics [apic ].saved_registers [pin ] = ioapic_read_entry (apic , pin );
567
567
}
568
568
569
569
return err ;
@@ -604,8 +604,7 @@ int restore_ioapic_entries(void)
604
604
continue ;
605
605
606
606
for_each_pin (apic , pin )
607
- ioapic_write_entry (apic , pin ,
608
- ioapics [apic ].saved_registers [pin ]);
607
+ ioapic_write_entry (apic , pin , ioapics [apic ].saved_registers [pin ]);
609
608
}
610
609
return 0 ;
611
610
}
@@ -617,12 +616,13 @@ static int find_irq_entry(int ioapic_idx, int pin, int type)
617
616
{
618
617
int i ;
619
618
620
- for (i = 0 ; i < mp_irq_entries ; i ++ )
619
+ for (i = 0 ; i < mp_irq_entries ; i ++ ) {
621
620
if (mp_irqs [i ].irqtype == type &&
622
621
(mp_irqs [i ].dstapic == mpc_ioapic_id (ioapic_idx ) ||
623
622
mp_irqs [i ].dstapic == MP_APIC_ALL ) &&
624
623
mp_irqs [i ].dstirq == pin )
625
624
return i ;
625
+ }
626
626
627
627
return -1 ;
628
628
}
@@ -662,9 +662,10 @@ static int __init find_isa_irq_apic(int irq, int type)
662
662
if (i < mp_irq_entries ) {
663
663
int ioapic_idx ;
664
664
665
- for_each_ioapic (ioapic_idx )
665
+ for_each_ioapic (ioapic_idx ) {
666
666
if (mpc_ioapic_id (ioapic_idx ) == mp_irqs [i ].dstapic )
667
667
return ioapic_idx ;
668
+ }
668
669
}
669
670
670
671
return -1 ;
@@ -1424,11 +1425,12 @@ static void __init setup_ioapic_ids_from_mpc_nocheck(void)
1424
1425
* We need to adjust the IRQ routing table if the ID
1425
1426
* changed.
1426
1427
*/
1427
- if (old_id != mpc_ioapic_id (ioapic_idx ))
1428
- for (i = 0 ; i < mp_irq_entries ; i ++ )
1428
+ if (old_id != mpc_ioapic_id (ioapic_idx )) {
1429
+ for (i = 0 ; i < mp_irq_entries ; i ++ ) {
1429
1430
if (mp_irqs [i ].dstapic == old_id )
1430
- mp_irqs [i ].dstapic
1431
- = mpc_ioapic_id (ioapic_idx );
1431
+ mp_irqs [i ].dstapic = mpc_ioapic_id (ioapic_idx );
1432
+ }
1433
+ }
1432
1434
1433
1435
/*
1434
1436
* Update the ID register according to the right value from
@@ -2666,12 +2668,10 @@ static int bad_ioapic_register(int idx)
2666
2668
2667
2669
static int find_free_ioapic_entry (void )
2668
2670
{
2669
- int idx ;
2670
-
2671
- for (idx = 0 ; idx < MAX_IO_APICS ; idx ++ )
2671
+ for (int idx = 0 ; idx < MAX_IO_APICS ; idx ++ ) {
2672
2672
if (ioapics [idx ].nr_registers == 0 )
2673
2673
return idx ;
2674
-
2674
+ }
2675
2675
return MAX_IO_APICS ;
2676
2676
}
2677
2677
@@ -2780,11 +2780,13 @@ int mp_unregister_ioapic(u32 gsi_base)
2780
2780
int ioapic , pin ;
2781
2781
int found = 0 ;
2782
2782
2783
- for_each_ioapic (ioapic )
2783
+ for_each_ioapic (ioapic ) {
2784
2784
if (ioapics [ioapic ].gsi_config .gsi_base == gsi_base ) {
2785
2785
found = 1 ;
2786
2786
break ;
2787
2787
}
2788
+ }
2789
+
2788
2790
if (!found ) {
2789
2791
pr_warn ("can't find IOAPIC for GSI %d\n" , gsi_base );
2790
2792
return - ENODEV ;
0 commit comments