* [PATCH][next] char: ipmi: remove redundant variable 'type' and check
@ 2025-07-08 15:18 Colin Ian King
2025-07-08 17:16 ` Corey Minyard
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-07-08 15:18 UTC (permalink / raw)
To: Corey Minyard, openipmi-developer; +Cc: kernel-janitors, linux-kernel
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 <colin.i.king@gmail.com>
---
drivers/char/ipmi/ipmi_si_intf.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index bb42dfe1c6a8..8b5524069c15 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -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);
--
2.50.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][next] char: ipmi: remove redundant variable 'type' and check
2025-07-08 15:18 [PATCH][next] char: ipmi: remove redundant variable 'type' and check Colin Ian King
@ 2025-07-08 17:16 ` Corey Minyard
0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2025-07-08 17:16 UTC (permalink / raw)
To: Colin Ian King; +Cc: openipmi-developer, kernel-janitors, linux-kernel
On Tue, Jul 08, 2025 at 04:18:05PM +0100, Colin Ian King wrote:
> 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.
Leftover stuff from previous changes. It's in my queue, thank you.
-corey
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/char/ipmi/ipmi_si_intf.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index bb42dfe1c6a8..8b5524069c15 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -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);
> --
> 2.50.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-08 17:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-08 15:18 [PATCH][next] char: ipmi: remove redundant variable 'type' and check Colin Ian King
2025-07-08 17:16 ` Corey Minyard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®