Skip to content

Commit e5032ea

Browse files
andy-shevKAGA-KOKO
authored andcommitted
genirq/irqdesc: Decrease indentation level in __irq_get_desc_lock()
There is a conditional that covers all the code for the entire function. Invert it and decrease indentation level. This also helps for further changes to be clearer and tidier. [ tglx: Removed line breaks ] Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 0128816 commit e5032ea

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

kernel/irq/irqdesc.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -896,27 +896,27 @@ unsigned int irq_get_next_irq(unsigned int offset)
896896
return irq_find_at_or_after(offset);
897897
}
898898

899-
struct irq_desc *
900-
__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
901-
unsigned int check)
899+
struct irq_desc *__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
900+
unsigned int check)
902901
{
903-
struct irq_desc *desc = irq_to_desc(irq);
902+
struct irq_desc *desc;
904903

905-
if (desc) {
906-
if (check & _IRQ_DESC_CHECK) {
907-
if ((check & _IRQ_DESC_PERCPU) &&
908-
!irq_settings_is_per_cpu_devid(desc))
909-
return NULL;
910-
911-
if (!(check & _IRQ_DESC_PERCPU) &&
912-
irq_settings_is_per_cpu_devid(desc))
913-
return NULL;
914-
}
904+
desc = irq_to_desc(irq);
905+
if (!desc)
906+
return NULL;
907+
908+
if (check & _IRQ_DESC_CHECK) {
909+
if ((check & _IRQ_DESC_PERCPU) && !irq_settings_is_per_cpu_devid(desc))
910+
return NULL;
915911

916-
if (bus)
917-
chip_bus_lock(desc);
918-
raw_spin_lock_irqsave(&desc->lock, *flags);
912+
if (!(check & _IRQ_DESC_PERCPU) && irq_settings_is_per_cpu_devid(desc))
913+
return NULL;
919914
}
915+
916+
if (bus)
917+
chip_bus_lock(desc);
918+
raw_spin_lock_irqsave(&desc->lock, *flags);
919+
920920
return desc;
921921
}
922922

0 commit comments

Comments
 (0)