* [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock
@ 2010-08-27 3:49 Eric Dumazet
2010-08-27 4:54 ` Eilon Greenstein
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2010-08-27 3:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Vladislav Zolotarov, Eilon Greenstein
bnx2x_trylock_hw_lock() returns a bool :
true if succeeded to acquire the lock.
false in case of error.
-EINVAL is not an acceptable value, since its promoted to true.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
Cosmetic patch, since compiler probably omits the code anyway.
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index f8c3f08..86cc4b0 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -781,7 +781,7 @@ static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource)
DP(NETIF_MSG_HW,
"resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n",
resource, HW_LOCK_MAX_RESOURCE_VALUE);
- return -EINVAL;
+ return false;
}
if (func <= 5)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock
2010-08-27 3:49 [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock Eric Dumazet
@ 2010-08-27 4:54 ` Eilon Greenstein
2010-08-27 5:04 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Eilon Greenstein @ 2010-08-27 4:54 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Vladislav Zolotarov
On Thu, 2010-08-26 at 20:49 -0700, Eric Dumazet wrote:
> bnx2x_trylock_hw_lock() returns a bool :
>
> true if succeeded to acquire the lock.
> false in case of error.
>
> -EINVAL is not an acceptable value, since its promoted to true.
Indeed - thanks Eric!
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
> ---
> Cosmetic patch, since compiler probably omits the code anyway.
>
> diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
> index f8c3f08..86cc4b0 100644
> --- a/drivers/net/bnx2x/bnx2x_main.c
> +++ b/drivers/net/bnx2x/bnx2x_main.c
> @@ -781,7 +781,7 @@ static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource)
> DP(NETIF_MSG_HW,
> "resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n",
> resource, HW_LOCK_MAX_RESOURCE_VALUE);
> - return -EINVAL;
> + return false;
> }
>
> if (func <= 5)
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock
2010-08-27 4:54 ` Eilon Greenstein
@ 2010-08-27 5:04 ` David Miller
2010-08-27 5:07 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2010-08-27 5:04 UTC (permalink / raw)
To: eilong; +Cc: eric.dumazet, netdev, vladz
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Fri, 27 Aug 2010 07:54:44 +0300
> On Thu, 2010-08-26 at 20:49 -0700, Eric Dumazet wrote:
>> bnx2x_trylock_hw_lock() returns a bool :
>>
>> true if succeeded to acquire the lock.
>> false in case of error.
>>
>> -EINVAL is not an acceptable value, since its promoted to true.
>
> Indeed - thanks Eric!
>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Acked-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-27 5:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-27 3:49 [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock Eric Dumazet
2010-08-27 4:54 ` Eilon Greenstein
2010-08-27 5:04 ` David Miller
2010-08-27 5:07 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox