From: Vasiliy Ulyanov Date: Tue, 19 Mar 2013 09:09:32 +0000 (+0400) Subject: [FIX] SWAP buffer memory copy optimization X-Git-Tag: accepted/tizen/mobile/20160407.001200~691^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edff58ef830ee28409e165361459c40b7fc4e78b;p=platform%2Fkernel%2Fswap-modules.git [FIX] SWAP buffer memory copy optimization while loop replaced with memcpy --- diff --git a/driver/storage.c b/driver/storage.c index 3542229..4338115 100644 --- a/driver/storage.c +++ b/driver/storage.c @@ -247,13 +247,11 @@ typedef int (*mec_post_event_pointer)(char *data, unsigned long len); static mec_post_event_pointer mec_post_event = NULL; #endif -static unsigned copy_into_cyclic_buffer (char *buffer, unsigned dst_offset, char *src, unsigned size) +static unsigned copy_into_cyclic_buffer (char *buffer, unsigned dst_offset, + char *src, unsigned size) { - unsigned nOffset = dst_offset; - char* pSource = src; - while (size--) - buffer[nOffset++] = *pSource++; - return nOffset; + memcpy(buffer + dst_offset, src, size); + return dst_offset + size; } static int CheckBufferSize (unsigned int nSize)