Skip to content

Commit

Permalink
async_tx: use memchr_inv
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Vinod Koul committed Jan 8, 2013
1 parent 1ba151c commit 2c88ae9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crypto/async_tx/async_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit 2c88ae9

Please sign in to comment.