From 2c88ae90939c2ef8ae80b07713b898c577b81598 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 28 Oct 2012 00:49:33 +0900 Subject: async_tx: use memchr_inv Use memchr_inv() to check the specified page is filled with zero. Signed-off-by: Akinobu Mita Cc: Vinod Koul Cc: Dan Williams Signed-off-by: Vinod Koul --- crypto/async_tx/async_xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'crypto/async_tx') diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c index 154cc84381c..8ade0a0481c 100644 --- a/crypto/async_tx/async_xor.c +++ b/crypto/async_tx/async_xor.c @@ -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 * -- cgit v1.2.3-70-g09d2