diff mbox series

ssb: remove unreachable code

Message ID 1621306352-3632-1-git-send-email-tiantao6@hisilicon.com
State New
Headers show
Series ssb: remove unreachable code | expand

Commit Message

Tian Tao May 18, 2021, 2:52 a.m. UTC
The return value of ssb_bus_unregister can only be 0 or 1, so this
condition if (err == -EBUSY) will not hold, so delete it.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/ssb/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michael Büsch May 20, 2021, 4:51 p.m. UTC | #1
On Tue, 18 May 2021 10:52:32 +0800
Tian Tao <tiantao6@hisilicon.com> wrote:

> The return value of ssb_bus_unregister can only be 0 or 1, so this

> condition if (err == -EBUSY) will not hold, so delete it.


> @@ -431,9 +431,7 @@ void ssb_bus_unregister(struct ssb_bus *bus)

>  	int err;

>  

>  	err = ssb_gpio_unregister(bus);

> -	if (err == -EBUSY)

> -		pr_debug("Some GPIOs are still in use\n");

> -	else if (err)

> +	if (err)

>  		pr_debug("Can not unregister GPIO driver: %i\n", err);

>  

>  	ssb_buses_lock();


Good catch.
Minor correction: The return value can be 0 or -1.

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


-- 
Michael
tiantao (H) May 21, 2021, 12:49 a.m. UTC | #2
在 2021/5/21 0:51, Michael Büsch 写道:
> On Tue, 18 May 2021 10:52:32 +0800

> Tian Tao <tiantao6@hisilicon.com> wrote:

>

>> The return value of ssb_bus_unregister can only be 0 or 1, so this

>> condition if (err == -EBUSY) will not hold, so delete it.

>> @@ -431,9 +431,7 @@ void ssb_bus_unregister(struct ssb_bus *bus)

>>   	int err;

>>   

>>   	err = ssb_gpio_unregister(bus);

>> -	if (err == -EBUSY)

>> -		pr_debug("Some GPIOs are still in use\n");

>> -	else if (err)

>> +	if (err)

>>   		pr_debug("Can not unregister GPIO driver: %i\n", err);

>>   

>>   	ssb_buses_lock();

> Good catch.

> Minor correction: The return value can be 0 or -1.

yes, you are right. thanks again.:-)
>

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

>
Kalle Valo May 21, 2021, 3:36 a.m. UTC | #3
"tiantao (H)" <tiantao6@huawei.com> writes:

> 在 2021/5/21 0:51, Michael Büsch 写道:

>> On Tue, 18 May 2021 10:52:32 +0800

>> Tian Tao <tiantao6@hisilicon.com> wrote:

>>

>>> The return value of ssb_bus_unregister can only be 0 or 1, so this

>>> condition if (err == -EBUSY) will not hold, so delete it.

>>> @@ -431,9 +431,7 @@ void ssb_bus_unregister(struct ssb_bus *bus)

>>>   	int err;

>>>     	err = ssb_gpio_unregister(bus);

>>> -	if (err == -EBUSY)

>>> -		pr_debug("Some GPIOs are still in use\n");

>>> -	else if (err)

>>> +	if (err)

>>>   		pr_debug("Can not unregister GPIO driver: %i\n", err);

>>>     	ssb_buses_lock();

>> Good catch.

>> Minor correction: The return value can be 0 or -1.

>

> yes, you are right. thanks again.:-)


I'll fix the commit log to match that.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Kalle Valo June 15, 2021, 10:11 a.m. UTC | #4
Tian Tao <tiantao6@hisilicon.com> wrote:

> The return value of ssb_bus_unregister can only be 0 or -1, so this

> condition if (err == -EBUSY) will not hold, so delete it.

> 

> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

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


Patch applied to wireless-drivers-next.git, thanks.

233bc2837282 ssb: remove unreachable code

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/1621306352-3632-1-git-send-email-tiantao6@hisilicon.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
diff mbox series

Patch

diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 0a26984..8fcf53c 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -431,9 +431,7 @@  void ssb_bus_unregister(struct ssb_bus *bus)
 	int err;
 
 	err = ssb_gpio_unregister(bus);
-	if (err == -EBUSY)
-		pr_debug("Some GPIOs are still in use\n");
-	else if (err)
+	if (err)
 		pr_debug("Can not unregister GPIO driver: %i\n", err);
 
 	ssb_buses_lock();