From: "Eilon Greenstein" <eilong@broadcom.com>
To: "Eric Dumazet" <eric.dumazet@gmail.com>
Cc: "David Miller" <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
"Vladislav Zolotarov" <vladz@broadcom.com>
Subject: Re: [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock
Date: Fri, 27 Aug 2010 07:54:44 +0300 [thread overview]
Message-ID: <1282884884.14181.1.camel@lb-tlvb-eilong.il.broadcom.com> (raw)
In-Reply-To: <1282880943.2501.13.camel@edumazet-laptop>
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)
>
>
>
next prev parent reply other threads:[~2010-08-27 4:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 3:49 [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock Eric Dumazet
2010-08-27 4:54 ` Eilon Greenstein [this message]
2010-08-27 5:04 ` David Miller
2010-08-27 5:07 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282884884.14181.1.camel@lb-tlvb-eilong.il.broadcom.com \
--to=eilong@broadcom.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vladz@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox