]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
async_tx: use memchr_inv
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 27 Oct 2012 15:49:33 +0000 (00:49 +0900)
committerVinod Koul <vinod.koul@intel.com>
Tue, 8 Jan 2013 06:04:56 +0000 (22:04 -0800)
Use memchr_inv() to check the specified page is filled with zero.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
crypto/async_tx/async_xor.c

index 154cc84381c23d07374a4a411bd4f4a7146606f5..8ade0a0481c67149e72d7878deb306a0fd33e5c2 100644 (file)
@@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
 
 static int page_is_zero(struct page *p, unsigned int offset, size_t len)
 {
-       char *a = page_address(p) + offset;
-       return ((*(u32 *) a) == 0 &&
-               memcmp(a, a + 4, len - 4) == 0);
+       return !memchr_inv(page_address(p) + offset, 0, len);
 }
 
 static inline struct dma_chan *