Skip to content

Commit

Permalink
staging: brcm80211: use min_t() instead of min()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henry Ptasinski authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent fa188ec commit 2618f3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/brcmsmac/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2618f3a

Please sign in to comment.