From 2618f3a63c968ba106832e26bf43a20dd3a119ec Mon Sep 17 00:00:00 2001 From: Henry Ptasinski Date: Thu, 1 Sep 2011 11:16:59 +0200 Subject: [PATCH] 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 --- drivers/staging/brcm80211/brcmsmac/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1