* [PATCH] rds: Fix min() warning in rds_message_inc_copy_to_user()
@ 2014-12-15 12:21 Geert Uytterhoeven
2014-12-15 16:49 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2014-12-15 12:21 UTC (permalink / raw)
To: Al Viro, David S. Miller; +Cc: netdev, linux-kernel, Geert Uytterhoeven
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>
---
net/rds/message.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/rds/message.c b/net/rds/message.c
index ff22022181875303..5a21e6f5986f1b82 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);
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rds: Fix min() warning in rds_message_inc_copy_to_user()
2014-12-15 12:21 [PATCH] rds: Fix min() warning in rds_message_inc_copy_to_user() Geert Uytterhoeven
@ 2014-12-15 16:49 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-12-15 16:49 UTC (permalink / raw)
To: geert; +Cc: viro, netdev, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=iso-8859-7, Size: 570 bytes --]
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Mon, 15 Dec 2014 13:21:42 +0100
> 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>
Also applied, thanks Geert.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-15 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 12:21 [PATCH] rds: Fix min() warning in rds_message_inc_copy_to_user() Geert Uytterhoeven
2014-12-15 16:49 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®