diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-10-28 00:49:33 +0900 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-07 22:04:56 -0800 |
commit | 725e579c9a0cc9cb5d2fafc5e517c2de7b3f24b7 (patch) | |
tree | c12fe3d9aa2cf88907546a0f76201333923832d6 /crypto | |
parent | 1c11ed58397f048d8187222927092b397a149d70 (diff) | |
download | linux-crypto-725e579c9a0cc9cb5d2fafc5e517c2de7b3f24b7.tar.gz linux-crypto-725e579c9a0cc9cb5d2fafc5e517c2de7b3f24b7.zip |
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 '')
-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 154cc843..8ade0a04 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 * |