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>
This commit is contained in:
@@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
|
|||||||
|
|
||||||
static int page_is_zero(struct page *p, unsigned int offset, size_t len)
|
static int page_is_zero(struct page *p, unsigned int offset, size_t len)
|
||||||
{
|
{
|
||||||
char *a = page_address(p) + offset;
|
return !memchr_inv(page_address(p) + offset, 0, len);
|
||||||
return ((*(u32 *) a) == 0 &&
|
|
||||||
memcmp(a, a + 4, len - 4) == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct dma_chan *
|
static inline struct dma_chan *
|
||||||
|
|||||||
Reference in New Issue
Block a user