Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

zram: use memcpy_to_bvec in zram_bvec_read

Use the proper helper instead of open coding the copy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20220303111905.321089-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
b3bd0a8a b7ab4611

+1 -3
+1 -3
drivers/block/zram/zram_drv.c
··· 1331 1331 goto out; 1332 1332 1333 1333 if (is_partial_io(bvec)) { 1334 - void *dst = kmap_atomic(bvec->bv_page); 1335 1334 void *src = kmap_atomic(page); 1336 1335 1337 - memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len); 1336 + memcpy_to_bvec(bvec, src + offset); 1338 1337 kunmap_atomic(src); 1339 - kunmap_atomic(dst); 1340 1338 } 1341 1339 out: 1342 1340 if (is_partial_io(bvec))