Skip to contentSkip to conversation

hp-wireless: remove unneeded goto/label in hpwl_init

PATCH In review Giedrius Statkevičius 2 participants 2 messages Aug 23, 2015 – Aug 26, 2015 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hp-wireless: remove unneeded goto/label in hpwl_init

acpi_bus_register_driver() already returns an appropriate value (0 on success, and some negative value on error) to be used in __init functions so the goto/label is redundant in hpwl_init thus remove it and directly return the value

---
 drivers/platform/x86/hp-wireless.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/platform/x86/hp-wireless.c +1 -6
index 4e4cc8b..988eedb 100644
@@ -114,14 +114,9 @@ static int __init hpwl_init(void)
 
 	pr_info("Initializing HPQ6001 module\n");
 	err = acpi_bus_register_driver(&hpwl_driver);
-	if (err) {
+	if (err)
 		pr_err("Unable to register HP wireless control driver.\n");
-		goto error_acpi_register;
-	}
-
-	return 0;
 
-error_acpi_register:
 	return err;
 }
 
Signature · 1 line
2.5.0
#1 lore raw
Quoted 6 lines · Giedrius Statkevičius

acpi_bus_register_driver() already returns an appropriate value (0 on success, and some negative value on error) to be used in __init functions so the goto/label is redundant in hpwl_init thus remove it and directly return the value

Thanks Giedrius, queued.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center