Skip to content

Commit b3bd0a8

Browse files
Christoph Hellwigaxboe
authored andcommitted
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>
1 parent b7ab461 commit b3bd0a8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/block/zram/zram_drv.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,12 +1331,10 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
13311331
goto out;
13321332

13331333
if (is_partial_io(bvec)) {
1334-
void *dst = kmap_atomic(bvec->bv_page);
13351334
void *src = kmap_atomic(page);
13361335

1337-
memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
1336+
memcpy_to_bvec(bvec, src + offset);
13381337
kunmap_atomic(src);
1339-
kunmap_atomic(dst);
13401338
}
13411339
out:
13421340
if (is_partial_io(bvec))

0 commit comments

Comments
 (0)