[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071105203816.3f8b2e7a.akpm@linux-foundation.org>
Date: Mon, 5 Nov 2007 20:38:16 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: WANG Cong <xiyou.wangcong@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Christoph Lameter <clameter@....com>, linux-mm@...ck.org,
Dong Pu <cocobear.cn@...il.com>
Subject: Re: [git Patch] mm/util.c: Remove needless code
On Tue, 6 Nov 2007 11:12:07 +0800 WANG Cong <xiyou.wangcong@...il.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@...il.com>
> Signed-off-by: Dong Pu <cocobear.cn@...il.com>
> Cc: Christoph Lameter <clameter@....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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists