All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: WANG Cong <xiyou.wangcong@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, Dong Pu <cocobear.cn@gmail.com>
Subject: Re: [git Patch] mm/util.c: Remove needless code
Date: Mon, 5 Nov 2007 20:38:16 -0800	[thread overview]
Message-ID: <20071105203816.3f8b2e7a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071106031207.GA2478@hacking>

On Tue, 6 Nov 2007 11:12:07 +0800 WANG Cong <xiyou.wangcong@gmail.com> wrote:

> 
> If the code can be executed there, 'new_size' is always larger
> than 'ks'. Thus min() is needless.
> 
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> Signed-off-by: Dong Pu <cocobear.cn@gmail.com>
> Cc: Christoph Lameter <clameter@sgi.com>
> 
> ---
>  mm/util.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/util.c b/mm/util.c
> index 5f64026..295c7aa 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -96,7 +96,7 @@ void *krealloc(const void *p, size_t new_size, gfp_t flags)
>  
>  	ret = kmalloc_track_caller(new_size, flags);
>  	if (ret) {
> -		memcpy(ret, p, min(new_size, ks));
> +		memcpy(ret, p, ks);
>  		kfree(p);
>  	}
>  	return ret;

Thanks.  This was already fixed by

http://www.mail-archive.com/mm-commits@vger.kernel.org/msg28294.html

(which is somewhere in one of my ever-growing number of for-2.6.24 queues)

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: WANG Cong <xiyou.wangcong@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, Dong Pu <cocobear.cn@gmail.com>
Subject: Re: [git Patch] mm/util.c: Remove needless code
Date: Mon, 5 Nov 2007 20:38:16 -0800	[thread overview]
Message-ID: <20071105203816.3f8b2e7a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071106031207.GA2478@hacking>

On Tue, 6 Nov 2007 11:12:07 +0800 WANG Cong <xiyou.wangcong@gmail.com> wrote:

> 
> If the code can be executed there, 'new_size' is always larger
> than 'ks'. Thus min() is needless.
> 
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> Signed-off-by: Dong Pu <cocobear.cn@gmail.com>
> Cc: Christoph Lameter <clameter@sgi.com>
> 
> ---
>  mm/util.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/util.c b/mm/util.c
> index 5f64026..295c7aa 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -96,7 +96,7 @@ void *krealloc(const void *p, size_t new_size, gfp_t flags)
>  
>  	ret = kmalloc_track_caller(new_size, flags);
>  	if (ret) {
> -		memcpy(ret, p, min(new_size, ks));
> +		memcpy(ret, p, ks);
>  		kfree(p);
>  	}
>  	return ret;

Thanks.  This was already fixed by

http://www.mail-archive.com/mm-commits@vger.kernel.org/msg28294.html

(which is somewhere in one of my ever-growing number of for-2.6.24 queues)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2007-11-06  4:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06  3:12 [git Patch] mm/util.c: Remove needless code WANG Cong
2007-11-06  3:12 ` WANG Cong
2007-11-06  4:00 ` Christoph Lameter
2007-11-06  4:00   ` Christoph Lameter
2007-11-06  4:38 ` Andrew Morton [this message]
2007-11-06  4:38   ` Andrew Morton
2007-11-06  5:06   ` WANG Cong
2007-11-06  5:06     ` WANG Cong

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=20071105203816.3f8b2e7a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=cocobear.cn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=xiyou.wangcong@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.