]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: brcm80211: use min_t() instead of min()
authorHenry Ptasinski <henryp@broadcom.com>
Thu, 1 Sep 2011 09:16:59 +0000 (11:16 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:38:48 +0000 (16:38 -0700)
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 <henryp@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/dma.c

index 8859a77e6750498e0e30e12f8ad651c4d99dcde4..6d9a0feafa57c8f7e539ff8c86fa78b8be4ed265 100644 (file)
@@ -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;