public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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