Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f112be65 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller
Browse files

xen-netback: fix type mismatch warning



Wiht the latest rework of the xen-netback driver, we get a warning
on ARM about the types passed into min():

drivers/net/xen-netback/rx.c: In function 'xenvif_rx_next_chunk':
include/linux/kernel.h:739:16: error: comparison of distinct pointer types lacks a cast [-Werror]

The reason is that XEN_PAGE_SIZE is not size_t here. There
is no actual bug, and we can easily avoid the warning using the
min_t() macro instead of min().

Fixes: eb1723a2 ("xen-netback: refactor guest rx")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarPaul Durrant <paul.durrant@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7086605a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -337,9 +337,9 @@ static void xenvif_rx_next_chunk(struct xenvif_queue *queue,
	frag_data += pkt->frag_offset;
	frag_len -= pkt->frag_offset;

	chunk_len = min(frag_len, XEN_PAGE_SIZE - offset);
	chunk_len = min(chunk_len,
			XEN_PAGE_SIZE -	xen_offset_in_page(frag_data));
	chunk_len = min_t(size_t, frag_len, XEN_PAGE_SIZE - offset);
	chunk_len = min_t(size_t, chunk_len, XEN_PAGE_SIZE -
					     xen_offset_in_page(frag_data));

	pkt->frag_offset += chunk_len;