Re: [PATCH] isa: refactor code to remove nested blocks
From: William Breathitt Gray
Date: Fri Jun 26 2026 - 07:13:45 EST
On Wed, Jun 24, 2026 at 05:50:49PM +0530, Syed Nayyar Waris wrote:
> Remove nested blocks in isa_bus_init()
>
> Suggested-by: William Breathitt Gray <wbg@xxxxxxxxxx>
> Signed-off-by: Syed Nayyar Waris <syednwaris@xxxxxxxxx>
Hi Syed,
The patch description is just repeating the subject line. Instead, you
should explain why this cleanup improves the module (e.g. makes the code
clearer).
You should also include a Link tag pointing to the previous discussion
about this change.
Link: https://lore.kernel.org/all/20260504063518.515620-1-wbg@xxxxxxxxxx/
Regardless, I agree with the code changes in this patch so here is my
Ack.
Acked-by: William Breathitt Gray <wbg@xxxxxxxxxx>
> ---
> 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
>