Linux driver-core infrastructure
 help / color / mirror / Atom feed
* [PATCH v2] isa: refactor code to remove nested blocks
@ 2026-07-01 20:58 Syed Nayyar Waris
  2026-07-02  3:16 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Syed Nayyar Waris @ 2026-07-01 20:58 UTC (permalink / raw)
  To: wbg; +Cc: gregkh, rafael, dakr, driver-core, linux-kernel, syednwaris

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/20260504063518.515620-1-wbg@kernel.org/

Acked-by: William Breathitt Gray <wbg@kernel.org>
Suggested-by: William Breathitt Gray <wbg@kernel.org>
Signed-off-by: Syed Nayyar Waris <syednwaris@gmail.com>
---
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(-)

diff --git a/drivers/base/isa.c b/drivers/base/isa.c
index 5887e4211f80..4e9f68080f39 100644
--- a/drivers/base/isa.c
+++ b/drivers/base/isa.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] isa: refactor code to remove nested blocks
  2026-07-01 20:58 [PATCH v2] isa: refactor code to remove nested blocks Syed Nayyar Waris
@ 2026-07-02  3:16 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2026-07-02  3:16 UTC (permalink / raw)
  To: Syed Nayyar Waris, wbg
  Cc: gregkh, rafael, dakr, driver-core, linux-kernel, syednwaris

On July 1, 2026 1:58:57 PM PDT, Syed Nayyar Waris <syednwaris@gmail.com> wrote:
>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/20260504063518.515620-1-wbg@kernel.org/
>
>Acked-by: William Breathitt Gray <wbg@kernel.org>
>Suggested-by: William Breathitt Gray <wbg@kernel.org>
>Signed-off-by: Syed Nayyar Waris <syednwaris@gmail.com>

LGTM. Thanks. 
Acked-by: Randy Dunlap <rdunlap@infradead.org>


>---
>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(-)
>
>diff --git a/drivers/base/isa.c b/drivers/base/isa.c
>index 5887e4211f80..4e9f68080f39 100644
>--- a/drivers/base/isa.c
>+++ b/drivers/base/isa.c
>@@ -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);


~Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-02  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 20:58 [PATCH v2] isa: refactor code to remove nested blocks Syed Nayyar Waris
2026-07-02  3:16 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox