From: Geert Uytterhoeven Date: Mon, 15 Dec 2014 12:21:42 +0000 (+0100) Subject: rds: Fix min() warning in rds_message_inc_copy_to_user() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=6ff4a8ad4b6eae5171754fb60418bc81834aa09b;p=openwrt%2Fstaging%2Fblogic.git rds: Fix min() warning in rds_message_inc_copy_to_user() net/rds/message.c: In function ‘rds_message_inc_copy_to_user’: net/rds/message.c:328: warning: comparison of distinct pointer types lacks a cast Use min_t(unsigned long, ...) like is done in rds_message_copy_from_user(). Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller --- diff --git a/net/rds/message.c b/net/rds/message.c index ff2202218187..5a21e6f5986f 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -325,7 +325,8 @@ int rds_message_inc_copy_to_user(struct rds_incoming *inc, struct iov_iter *to) copied = 0; while (iov_iter_count(to) && copied < len) { - to_copy = min(iov_iter_count(to), sg->length - vec_off); + to_copy = min_t(unsigned long, iov_iter_count(to), + sg->length - vec_off); to_copy = min_t(unsigned long, to_copy, len - copied); rds_stats_add(s_copy_to_user, to_copy);