From: Henry Ptasinski Date: Thu, 1 Sep 2011 09:16:59 +0000 (+0200) Subject: staging: brcm80211: use min_t() instead of min() X-Git-Tag: next-20111004~7^2~383 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2618f3a63c968ba106832e26bf43a20dd3a119ec;p=karo-tx-linux.git staging: brcm80211: use min_t() instead of min() Also eliminate a cast to int that could cause issues with very large values of di->rxbufsize (as suggested by Dan Carpenter). Signed-off-by: Henry Ptasinski Signed-off-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c index 8859a77e6750..6d9a0feafa57 100644 --- a/drivers/staging/brcm80211/brcmsmac/dma.c +++ b/drivers/staging/brcm80211/brcmsmac/dma.c @@ -917,7 +917,7 @@ struct sk_buff *dma_rx(struct dma_pub *pub) tail = head; while ((resid > 0) && (p = _dma_getnextrxp(di, false))) { tail->next = p; - pkt_len = min(resid, (int)di->rxbufsize); + pkt_len = min_t(uint, resid, di->rxbufsize); __skb_trim(p, pkt_len); tail = p;