Skip to content

Commit c5dbf04

Browse files
harshimogalapalliij-intel
authored andcommitted
platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes()
All cases in switch-case have a same goto on error, move the return check out of the switch. This is a cleanup. Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 7a3c36e commit c5dbf04

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,21 +630,19 @@ static int hp_add_other_attributes(int attr_type)
630630
switch (attr_type) {
631631
case HPWMI_SECURE_PLATFORM_TYPE:
632632
ret = hp_populate_secure_platform_data(attr_name_kobj);
633-
if (ret)
634-
goto err_other_attr_init;
635633
break;
636634

637635
case HPWMI_SURE_START_TYPE:
638636
ret = hp_populate_sure_start_data(attr_name_kobj);
639-
if (ret)
640-
goto err_other_attr_init;
641637
break;
642638

643639
default:
644640
ret = -EINVAL;
645-
goto err_other_attr_init;
646641
}
647642

643+
if (ret)
644+
goto err_other_attr_init;
645+
648646
mutex_unlock(&bioscfg_drv.mutex);
649647
return 0;
650648

0 commit comments

Comments
 (0)