Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] ssb: Call ssb_bus_may_powerdown(bus) only once in ssb_bus_register()
@ 2024-09-24 19:33 Markus Elfring
  2024-09-25 16:27 ` Michael Büsch
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2024-09-24 19:33 UTC (permalink / raw)
  To: linux-wireless, Michael Büsch; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 24 Sep 2024 21:24:13 +0200

A ssb_bus_may_powerdown(bus) call was immediately used after a return value
check for a ssb_fetch_invariants() call in this function implementation.
Thus call such a function only once instead directly before the check.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/ssb/main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index aa6165e3db4a..458858b5472e 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -663,11 +663,9 @@ ssb_bus_register(struct ssb_bus *bus,
 	ssb_extif_init(&bus->extif);
 	ssb_mipscore_init(&bus->mipscore);
 	err = ssb_fetch_invariants(bus, get_invariants);
-	if (err) {
-		ssb_bus_may_powerdown(bus);
-		goto err_pcmcia_exit;
-	}
 	ssb_bus_may_powerdown(bus);
+	if (err)
+		goto err_pcmcia_exit;

 	/* Queue it for attach.
 	 * See the comment at the ssb_is_early_boot definition.
--
2.46.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ssb: Call ssb_bus_may_powerdown(bus) only once in ssb_bus_register()
  2024-09-24 19:33 [PATCH] ssb: Call ssb_bus_may_powerdown(bus) only once in ssb_bus_register() Markus Elfring
@ 2024-09-25 16:27 ` Michael Büsch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Büsch @ 2024-09-25 16:27 UTC (permalink / raw)
  To: Markus Elfring; +Cc: linux-wireless, LKML, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

On Tue, 24 Sep 2024 21:33:49 +0200
Markus Elfring <Markus.Elfring@web.de> wrote:

> diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
> index aa6165e3db4a..458858b5472e 100644
> --- a/drivers/ssb/main.c
> +++ b/drivers/ssb/main.c
> @@ -663,11 +663,9 @@ ssb_bus_register(struct ssb_bus *bus,
>  	ssb_extif_init(&bus->extif);
>  	ssb_mipscore_init(&bus->mipscore);
>  	err = ssb_fetch_invariants(bus, get_invariants);
> -	if (err) {
> -		ssb_bus_may_powerdown(bus);
> -		goto err_pcmcia_exit;
> -	}
>  	ssb_bus_may_powerdown(bus);
> +	if (err)
> +		goto err_pcmcia_exit;
> 
>  	/* Queue it for attach.
>  	 * See the comment at the ssb_is_early_boot definition.


Acked-by: Michael Büsch <m@bues.ch>


-- 
Michael Büsch
https://bues.ch/

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-25 17:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-24 19:33 [PATCH] ssb: Call ssb_bus_may_powerdown(bus) only once in ssb_bus_register() Markus Elfring
2024-09-25 16:27 ` Michael Büsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox