NET: pktgen - fix compile warning
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 6 Nov 2010 20:11:38 +0000 (20:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 7 Nov 2010 13:28:01 +0000 (05:28 -0800)
This should fix the following warning:

net/core/pktgen.c: In function ‘pktgen_if_write’:
net/core/pktgen.c:890: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Reviewed-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c

index fbce4b05a53e79b502e37e7d768228dc6155b5d9..1992cd050e26012a6ee6ffe2504456c53d15764d 100644 (file)
@@ -887,7 +887,7 @@ static ssize_t pktgen_if_write(struct file *file,
        i += len;
 
        if (debug) {
-               size_t copy = min(count, 1023);
+               size_t copy = min_t(size_t, count, 1023);
                char tb[copy + 1];
                if (copy_from_user(tb, user_buffer, copy))
                        return -EFAULT;