diff mbox

NET: pktgen - fix compile warning

Message ID 20101107061138.GA6601@core.coreip.homeip.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dmitry Torokhov Nov. 7, 2010, 6:11 a.m. UTC
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>
---

Unless somebody already beat me to it...

 net/core/pktgen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Nelson Elhage Nov. 7, 2010, 1:16 p.m. UTC | #1
Good catch; sorry I missed that.

Reviewed-by: Nelson Elhage <nelhage@ksplice.com>

On Sat, Nov 06, 2010 at 11:11:38PM -0700, Dmitry Torokhov wrote:
> 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>
> ---
> 
> Unless somebody already beat me to it...
> 
>  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;
> 
> -- 
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 7, 2010, 1:28 p.m. UTC | #2
From: Nelson Elhage <nelhage@ksplice.com>

Date: Sun, 7 Nov 2010 08:16:24 -0500

> Good catch; sorry I missed that.

> 

> Reviewed-by: Nelson Elhage <nelhage@ksplice.com>

> 

> On Sat, Nov 06, 2010 at 11:11:38PM -0700, Dmitry Torokhov wrote:

>> 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>


Applied.
diff mbox

Patch

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;