* [patch -next] bnx2x: remove bogus check
@ 2010-12-21 7:04 Dan Carpenter
2010-12-21 13:48 ` Eilon Greenstein
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-12-21 7:04 UTC (permalink / raw)
To: Eilon Greenstein; +Cc: netdev, kernel-janitors
We dereferenced params on the line before so it's too late to check if
params is NULL. In fact, params can never be NULL and strict_cos is
either 0 or 1 so that part of the check is bogus too. Let's remove it.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index 97cbee2..43b0de2 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -354,9 +354,6 @@ u8 bnx2x_ets_strict(const struct link_params *params, const u8 strict_cos)
struct bnx2x *bp = params->bp;
u32 val = 0;
- if ((1 < strict_cos) && (NULL == params))
- return -EINVAL;
-
DP(NETIF_MSG_LINK, "ETS enabled strict configuration\n");
/**
* Bitmap of 5bits length. Each bit specifies whether the entry behaves
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch -next] bnx2x: remove bogus check
2010-12-21 7:04 [patch -next] bnx2x: remove bogus check Dan Carpenter
@ 2010-12-21 13:48 ` Eilon Greenstein
2010-12-21 18:51 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eilon Greenstein @ 2010-12-21 13:48 UTC (permalink / raw)
To: Dan Carpenter; +Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
On Mon, 2010-12-20 at 23:04 -0800, Dan Carpenter wrote:
> We dereferenced params on the line before so it's too late to check if
> params is NULL. In fact, params can never be NULL and strict_cos is
> either 0 or 1 so that part of the check is bogus too. Let's remove it.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Thanks Dan!
Acked-by: Eilon Greenstein <eilong@broadcom.com>
>
> diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
> index 97cbee2..43b0de2 100644
> --- a/drivers/net/bnx2x/bnx2x_link.c
> +++ b/drivers/net/bnx2x/bnx2x_link.c
> @@ -354,9 +354,6 @@ u8 bnx2x_ets_strict(const struct link_params *params, const u8 strict_cos)
> struct bnx2x *bp = params->bp;
> u32 val = 0;
>
> - if ((1 < strict_cos) && (NULL == params))
> - return -EINVAL;
> -
> DP(NETIF_MSG_LINK, "ETS enabled strict configuration\n");
> /**
> * Bitmap of 5bits length. Each bit specifies whether the entry behaves
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch -next] bnx2x: remove bogus check
2010-12-21 13:48 ` Eilon Greenstein
@ 2010-12-21 18:51 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-12-21 18:51 UTC (permalink / raw)
To: eilong; +Cc: error27, netdev, kernel-janitors
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Tue, 21 Dec 2010 15:48:36 +0200
> On Mon, 2010-12-20 at 23:04 -0800, Dan Carpenter wrote:
>> We dereferenced params on the line before so it's too late to check if
>> params is NULL. In fact, params can never be NULL and strict_cos is
>> either 0 or 1 so that part of the check is bogus too. Let's remove it.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> Thanks Dan!
>
> Acked-by: Eilon Greenstein <eilong@broadcom.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-21 18:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-21 7:04 [patch -next] bnx2x: remove bogus check Dan Carpenter
2010-12-21 13:48 ` Eilon Greenstein
2010-12-21 18:51 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).