diff options
Diffstat (limited to 'drivers/net/ethoc.c')
-rw-r--r-- | drivers/net/ethoc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 96f5b2a2d2c5..9c950bb5e90c 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -664,7 +664,8 @@ static int ethoc_open(struct net_device *dev) | |||
664 | return ret; | 664 | return ret; |
665 | 665 | ||
666 | /* calculate the number of TX/RX buffers, maximum 128 supported */ | 666 | /* calculate the number of TX/RX buffers, maximum 128 supported */ |
667 | num_bd = min(128, (dev->mem_end - dev->mem_start + 1) / ETHOC_BUFSIZ); | 667 | num_bd = min_t(unsigned int, |
668 | 128, (dev->mem_end - dev->mem_start + 1) / ETHOC_BUFSIZ); | ||
668 | priv->num_tx = max(min_tx, num_bd / 4); | 669 | priv->num_tx = max(min_tx, num_bd / 4); |
669 | priv->num_rx = num_bd - priv->num_tx; | 670 | priv->num_rx = num_bd - priv->num_tx; |
670 | ethoc_write(priv, TX_BD_NUM, priv->num_tx); | 671 | ethoc_write(priv, TX_BD_NUM, priv->num_tx); |