netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nelson Elhage <nelhage@ksplice.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] NET: pktgen - fix compile warning
Date: Sun, 7 Nov 2010 08:16:24 -0500	[thread overview]
Message-ID: <20101107131624.GD3032@ksplice.com> (raw)
In-Reply-To: <20101107061138.GA6601@core.coreip.homeip.net>

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

  reply	other threads:[~2010-11-07 13:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07  6:11 [PATCH] NET: pktgen - fix compile warning Dmitry Torokhov
2010-11-07 13:16 ` Nelson Elhage [this message]
2010-11-07 13:28   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101107131624.GD3032@ksplice.com \
    --to=nelhage@ksplice.com \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).