* [PATCH] net: replace min with min_t in pktgen_if_write
@ 2010-11-09 16:37 Davidlohr Bueso
2010-11-09 16:40 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2010-11-09 16:37 UTC (permalink / raw)
To: David Miller, Robert Olsson; +Cc: LKML, Network Development
From: Davidlohr Bueso <dave@gnu.org>
This addresses the following compiler (gcc 4.4.5) warning:
CC [M] net/core/pktgen.o
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: Davidlohr Bueso <dave@gnu.org>
---
net/core/pktgen.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fbce4b0..1992cd0 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: replace min with min_t in pktgen_if_write
2010-11-09 16:37 [PATCH] net: replace min with min_t in pktgen_if_write Davidlohr Bueso
@ 2010-11-09 16:40 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-11-09 16:40 UTC (permalink / raw)
To: dave; +Cc: robert.olsson, linux-kernel, netdev
From: Davidlohr Bueso <dave@gnu.org>
Date: Tue, 09 Nov 2010 13:37:13 -0300
> From: Davidlohr Bueso <dave@gnu.org>
>
> This addresses the following compiler (gcc 4.4.5) warning:
>
> CC [M] net/core/pktgen.o
> 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: Davidlohr Bueso <dave@gnu.org>
Already fixed in net-2.6:
commit 86c2c0a8a4965ae5cbc0ff97ed39a4472e8e9b23
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: Sat Nov 6 20:11:38 2010 +0000
NET: pktgen - fix compile warning
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>
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fbce4b0..1992cd0 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-09 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 16:37 [PATCH] net: replace min with min_t in pktgen_if_write Davidlohr Bueso
2010-11-09 16:40 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).