char: ipmi: remove redundant variable 'type' and check
Subsystems (2)
PATCH 1/1 char: ipmi: remove redundant variable 'type' and check
The variable 'type' is assigned the value SI_INVALID which is zero and later checks of 'type' is non-zero (which is always false). The variable is not referenced anywhere else, so it is redundant and so is the check, so remove these.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/char/ipmi/ipmi_si_intf.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +0 -4
@@ -2108,7 +2108,6 @@ static bool __init ipmi_smi_info_same(struct smi_info *e1, struct smi_info *e2)static int __init init_ipmi_si (void ) {struct smi_info *e, *e2; -enum ipmi_addr_src type =SI_INVALID ;if (initialized)return 0 ;
@@ -2190,9 +2189,6 @@ static int __init init_ipmi_si(void) initialized = true;mutex_unlock (&smi_infos_lock); -if (type) -return 0 ; -mutex_lock (&smi_infos_lock);if (unload_when_empty &&list_empty (&smi_infos)) {mutex_unlock (&smi_infos_lock);
Signature · 1 line
2.50.0
Corey Minyard
maintainerQuoted 4 lines · Colin Ian King
The variable 'type' is assigned the value
SI_INVALIDwhich is zero and later checks of 'type' is non-zero (which is always false). The variable is not referenced anywhere else, so it is redundant and so is the check, so remove these.
Leftover stuff from previous changes. It's in my queue, thank you.
-corey
Quoted 31 lines
Signed-off-by Colin Ian King <[email protected]>--- drivers/char/ipmi/ipmi_si_intf.c | 4 ---- 1 file changed, 4 deletions(-)drivers/char/ipmi/ipmi_si_intf.c +0
-4@@ -2108,7 +2108,6 @@ static bool __init ipmi_smi_info_same(struct smi_info *e1, struct smi_info *e2)static int __init init_ipmi_si (void ) {struct smi_info *e, *e2; -enum ipmi_addr_src type =SI_INVALID ;if (initialized)return 0 ;@@ -2190,9 +2189,6 @@ static int __init init_ipmi_si(void) initialized = true;mutex_unlock (&smi_infos_lock); -if (type) -return 0 ; -mutex_lock (&smi_infos_lock);if (unload_when_empty &&list_empty (&smi_infos)) {mutex_unlock (&smi_infos_lock);Signature · 1 line
2.50.0