powerpc/ps3: Simplify control flow in ps3_{virq,irq_plug}_setup()
Subsystems (2)
PATCH 1/1 powerpc/ps3: Simplify control flow in ps3_{virq,irq_plug}_setup()
In ps3_virq_setup() and ps3_irq_plug_setup(), remove the goto statements and handle errors directly.
Signed-off-by Thorsten Blum <[email protected]>
--- arch/powerpc/platforms/ps3/interrupt.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
arch/powerpc/platforms/ps3/interrupt.c +6 -16
@@ -184,8 +184,7 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,if (!*virq) {FAIL ("%s:%d: irq_create_mapping failed: outlet %lu\n" , __func__, __LINE__, outlet); - result = -ENOMEM ; - goto fail_create; +return -ENOMEM ; } DBG("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__,
@@ -196,17 +195,13 @@ static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,if (result) {FAIL ("%s:%d: irq_set_chip_data failed\n" , __func__, __LINE__); - goto fail_set; +irq_dispose_mapping (*virq); +return result; }ps3_chip_mask (irq_get_irq_data (*virq));return result; - -fail_set: -irq_dispose_mapping (*virq); -fail_create: -return result; }/**
@@ -250,7 +245,7 @@ int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,if (result) {FAIL ("%s:%d: ps3_virq_setup failed\n" , __func__, __LINE__); - goto fail_setup; +return result; } pd =irq_get_chip_data (*virq);
@@ -263,16 +258,11 @@ int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,if (result) {FAIL ("%s:%d: lv1_connect_irq_plug_ext failed: %s\n" , __func__, __LINE__,ps3_result (result)); - result = -EPERM ; - goto fail_connect; +ps3_virq_destroy (*virq); +return -EPERM ; }return result; - -fail_connect: -ps3_virq_destroy (*virq); -fail_setup: -return result; }EXPORT_SYMBOL_GPL (ps3_irq_plug_setup);
Quoted 4 lines · Thorsten Blum
In
ps3_virq_setup()andps3_irq_plug_setup(), remove the goto statements and handle errors directly.Signed-off-by Thorsten Blum <[email protected]>
Reviewed-by Geert Uytterhoeven <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 4 lines · Thorsten Blum
In
ps3_virq_setup()andps3_irq_plug_setup(), remove the goto statements and handle errors directly.Signed-off-by Thorsten Blum <[email protected]>
Reviewed-by Amit Machhiwal <[email protected]>
Thanks,
Amit
Quoted 4 lines · Thorsten Blum
In
ps3_virq_setup()andps3_irq_plug_setup(), remove the goto statements and handle errors directly.
Applied to powerpc/next.
[1/1] powerpc/ps3: Simplify control flow in ps3_{virq,irq_plug}_setup()
https://git.kernel.org/powerpc/c/4d9f2ca2e37ce7fe7567761b2392748456e1ce43
cheers