diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-10-27 11:49:33 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-08 01:04:56 -0500 |
commit | 2c88ae90939c2ef8ae80b07713b898c577b81598 (patch) | |
tree | fc4ea2caa03fb7443c0951a7a16dbef71ba51f5c /crypto | |
parent | 1ba151cdf5ac120fc829ee6524fefedc6828947f (diff) |
async_tx: use memchr_inv
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>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/async_tx/async_xor.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c index 154cc84381c2..8ade0a0481c6 100644 --- a/crypto/async_tx/async_xor.c +++ b/crypto/async_tx/async_xor.c | |||
@@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor); | |||
230 | 230 | ||
231 | static int page_is_zero(struct page *p, unsigned int offset, size_t len) | 231 | static int page_is_zero(struct page *p, unsigned int offset, size_t len) |
232 | { | 232 | { |
233 | char *a = page_address(p) + offset; | 233 | return !memchr_inv(page_address(p) + offset, 0, len); |
234 | return ((*(u32 *) a) == 0 && | ||
235 | memcmp(a, a + 4, len - 4) == 0); | ||
236 | } | 234 | } |
237 | 235 | ||
238 | static inline struct dma_chan * | 236 | static inline struct dma_chan * |