Skip to content

Commit

Permalink
rds: Fix min() warning in rds_message_inc_copy_to_user()
Browse files Browse the repository at this point in the history
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 <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geert Uytterhoeven authored and David S. Miller committed Dec 15, 2014
1 parent 50262c8 commit 6ff4a8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/rds/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6ff4a8a

Please sign in to comment.