netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NET: pktgen - fix compile warning
@ 2010-11-07  6:11 Dmitry Torokhov
  2010-11-07 13:16 ` Nelson Elhage
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2010-11-07  6:11 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Nelson Elhage

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] NET: pktgen - fix compile warning
  2010-11-07  6:11 [PATCH] NET: pktgen - fix compile warning Dmitry Torokhov
@ 2010-11-07 13:16 ` Nelson Elhage
  2010-11-07 13:28   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Nelson Elhage @ 2010-11-07 13:16 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: netdev, David S. Miller

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] NET: pktgen - fix compile warning
  2010-11-07 13:16 ` Nelson Elhage
@ 2010-11-07 13:28   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-11-07 13:28 UTC (permalink / raw)
  To: nelhage; +Cc: dmitry.torokhov, netdev

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-07 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-07  6:11 [PATCH] NET: pktgen - fix compile warning Dmitry Torokhov
2010-11-07 13:16 ` Nelson Elhage
2010-11-07 13:28   ` 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).