aboutsummaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-09-02 15:22:48 +0100
committerMister Oyster <oysterized@gmail.com>2017-07-04 11:51:18 +0200
commit57ef15e1ea9d590bd9e27e03c6a9397d204405a4 (patch)
treea5004b2fa68640a6272bd68733f84a9ee36c1cfc /android
parent1e5ba7fd757772fbec6143566916e92028b164b2 (diff)
net: ti: cpmac: Fix compiler warning due to type confusion
commit 2f5281ba2a8feaf6f0aee93356f350855bb530fc upstream. cpmac_start_xmit() used the max() macro on skb->len (an unsigned int) and ETH_ZLEN (a signed int literal). This led to the following compiler warning: In file included from include/linux/list.h:8:0, from include/linux/module.h:9, from drivers/net/ethernet/ti/cpmac.c:19: drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_start_xmit': include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast (void) (&_max1 == &_max2); \ ^ drivers/net/ethernet/ti/cpmac.c:560:8: note: in expansion of macro 'max' len = max(skb->len, ETH_ZLEN); ^ On top of this, it assigned the result of the max() macro to a signed integer whilst all further uses of it result in it being cast to varying widths of unsigned integer. Fix this up by using max_t to ensure the comparison is performed as unsigned integers, and for consistency change the type of the len variable to unsigned int. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'android')
0 files changed, 0 insertions, 0 deletions