diff mbox

[-next] bnx2x: remove bogus check

Message ID 20101221070401.GF1936@bicker
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter Dec. 21, 2010, 7:04 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eilon Greenstein Dec. 21, 2010, 1:48 p.m. UTC | #1
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
> 




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 21, 2010, 6:51 p.m. UTC | #2
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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