提交 2618f3a6 编写于 作者: H Henry Ptasinski 提交者: Greg Kroah-Hartman

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: NHenry Ptasinski <henryp@broadcom.com>
Signed-off-by: NRoland Vossen <rvossen@broadcom.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 fa188ec8
...@@ -917,7 +917,7 @@ struct sk_buff *dma_rx(struct dma_pub *pub) ...@@ -917,7 +917,7 @@ struct sk_buff *dma_rx(struct dma_pub *pub)
tail = head; tail = head;
while ((resid > 0) && (p = _dma_getnextrxp(di, false))) { while ((resid > 0) && (p = _dma_getnextrxp(di, false))) {
tail->next = p; tail->next = p;
pkt_len = min(resid, (int)di->rxbufsize); pkt_len = min_t(uint, resid, di->rxbufsize);
__skb_trim(p, pkt_len); __skb_trim(p, pkt_len);
tail = p; tail = p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册