Skip to contentSkip to conversation

bnx2x: remove bogus check

PATCH Applied Dan Carpenter 3 participants 3 messages Dec 21, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: remove bogus check

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.

drivers/net/bnx2x/bnx2x_link.c +0 -3
index 97cbee2..43b0de2 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

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.

Thanks Dan!

Quoted 16 lines
drivers/net/bnx2x/bnx2x_link.c +0 -3
index 97cbee2..43b0de2 100644
@@ -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
maintainer Applied
#2 lore raw

From: "Eilon Greenstein" <[email protected]>
Date: Tue, 21 Dec 2010 15:48:36 +0200

Quoted 10 lines · Dan Carpenter
Quoted 5 lines

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.

Thanks Dan!

Applied, thanks everyone.