isa: refactor code to remove nested blocks
Subsystems (2)
PATCH v2 1/1 isa: refactor code to remove nested blocks
Remove nested blocks in isa_bus_init(). This will make the module easy-to-understand and make the code clearer.
Previous discussion regarding this change can be found at below link:
https://lore.kernel.org/all/[email protected]/
---
Changes in v2:
- Make the patch description more comprehensive and thorough in its explanation
--- drivers/base/isa.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/base/isa.c +9 -7
@@ -166,14 +166,16 @@ static int __init isa_bus_init(void)int error; error =bus_register (&isa_bus_type); -if (!error) { - isa_bus =root_device_register ("isa" ); -if (IS_ERR (isa_bus)) { - error =PTR_ERR (isa_bus); -bus_unregister (&isa_bus_type); - } +if (error) +return error; + + isa_bus =root_device_register ("isa" ); +if (IS_ERR (isa_bus)) { +bus_unregister (&isa_bus_type); +return PTR_ERR (isa_bus); } -return error; + +return 0 ; }postcore_initcall (isa_bus_init);
Signature · 1 line
2.25.1
Quoted 9 lines · Syed Nayyar Waris
Remove nested blocks in
isa_bus_init(). This will make the module easy-to-understand and make the code clearer.
Previous discussion regarding this change can be found at below link:
https://lore.kernel.org/all/[email protected]/Suggested-by William Breathitt Gray <[email protected]>Signed-off-by Syed Nayyar Waris <[email protected]>
LGTM. Thanks.
Quoted 26 lines
---
Changes in v2:
- Make the patch description more comprehensive and thorough in its explanation
---drivers/base/isa.c| 16 +++++++++-------1 file changed, 9 insertions(+), 7 deletions(-)drivers/base/isa.c +4
-6@@ -166,14 +166,16 @@ static int __init isa_bus_init(void)int error; error =bus_register (&isa_bus_type); -if (!error) { - isa_bus =root_device_register ("isa" ); -if (IS_ERR (isa_bus)) { - error =PTR_ERR (isa_bus); -bus_unregister (&isa_bus_type); - } +if (error) +return error; + + isa_bus =root_device_register ("isa" );
drivers/base/isa.c static int __init isa_bus_init(void) · line 181
Quoted 10 lines
drivers/base/isa.c +5
-1+if (IS_ERR (isa_bus)) { +bus_unregister (&isa_bus_type); +return PTR_ERR (isa_bus); } -return error; + +return 0 ; }postcore_initcall (isa_bus_init);
~Randy
Quoted 1 line · Syed Nayyar Waris
[PATCH v2] isa: refactor code to remove nested blocks
Applied, thanks!
Branch: driver-core-testing
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git
[1/1] isa: refactor code to remove nested blocks
commit: 0fa8e47dea17
The patch will appear in the next linux-next integration (typically within 24 hours on weekdays).
The patch is in the driver-core-testing branch and will be promoted to driver-core-next after validation.