Skip to contentSkip to conversation

NET: pktgen - fix compile warning

PATCH Applied Dmitry Torokhov 3 participants 3 messages Nov 7, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

Unless somebody already beat me to it...

 net/core/pktgen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/core/pktgen.c +1 -1
index fbce4b0..1992cd0 100644
@@ -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;
Signature · 1 line
Dmitry
Reviewed-by on v1 1/1
#1 lore raw

Good catch; sorry I missed that.

Quoted 30 lines · Dmitry Torokhov

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

---

Unless somebody already beat me to it...

 net/core/pktgen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/core/pktgen.c +1 -1
index fbce4b0..1992cd0 100644
@@ -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;
Signature · 2 lines
-- 
Dmitry
maintainer Applied
#2 lore raw

From: Nelson Elhage <[email protected]>
Date: Sun, 7 Nov 2010 08:16:24 -0500

Quoted 11 lines

Good catch; sorry I missed that.

Quoted 6 lines · Dmitry Torokhov

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

Applied.