linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [git Patch] mm/util.c: Remove needless code
@ 2007-11-06  3:12 WANG Cong
  2007-11-06  4:00 ` Christoph Lameter
  2007-11-06  4:38 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: WANG Cong @ 2007-11-06  3:12 UTC (permalink / raw)
  To: LKML; +Cc: Christoph Lameter, linux-mm, Andrew Morton, Dong Pu

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;

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

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

end of thread, other threads:[~2007-11-06  5:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-06  3:12 [git Patch] mm/util.c: Remove needless code WANG Cong
2007-11-06  4:00 ` Christoph Lameter
2007-11-06  4:38 ` Andrew Morton
2007-11-06  5:06   ` WANG Cong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox