summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2012-04-04 02:27:42 +0000
committerDavid S. Miller <davem@davemloft.net>2012-04-04 18:03:45 -0400
commitcfcadc97a890b81f619715739ef101f8c2010e6b (patch)
treed988b8c470ea3d15528a1cdd00c2c37489b4fd1e /drivers
parent123edb182793fed2adfa51b607f6aa0c3b533e9c (diff)
bnx2x: add missing parenthesis to prevent u32 overflow
Commit b475d78 lacked two pairs of parenthesis, causing an overflow in the congestion management. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
index e6bb9f4c619..2b7a2bd0592 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
@@ -409,7 +409,7 @@ static inline void bnx2x_init_min(const struct cmng_init_input *input_data,
*/
vdata->vnic_min_rate[vnic].vn_credit_delta =
(u32)input_data->vnic_min_rate[vnic] * 100 *
- T_FAIR_COEF / (8 * 100 * vnicWeightSum);
+ (T_FAIR_COEF / (8 * 100 * vnicWeightSum));
if (vdata->vnic_min_rate[vnic].vn_credit_delta <
pdata->fair_vars.fair_threshold +
MIN_ABOVE_THRESH) {
@@ -446,7 +446,7 @@ static inline void bnx2x_init_fw_wrr(const struct cmng_init_input *input_data,
*/
ccd[cos] =
(u32)input_data->cos_min_rate[cos] * 100 *
- T_FAIR_COEF / (8 * 100 * cosWeightSum);
+ (T_FAIR_COEF / (8 * 100 * cosWeightSum));
if (ccd[cos] < pdata->fair_vars.fair_threshold
+ MIN_ABOVE_THRESH) {
ccd[cos] =