From: Ira Weiny <ira.weiny@xxxxxxxxx> Remove kmap/mem*()/kunmap pattern and use memcpy_to_page() Cc: Brian King <brking@xxxxxxxxxx> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx> --- drivers/scsi/ipr.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index b0aa58d117cc..3cdd8db24270 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -3912,7 +3912,6 @@ static int ipr_copy_ucode_buffer(struct ipr_sglist *sglist, { int bsize_elem, i, result = 0; struct scatterlist *sg; - void *kaddr; /* Determine the actual number of bytes per element */ bsize_elem = PAGE_SIZE * (1 << sglist->order); @@ -3923,10 +3922,7 @@ static int ipr_copy_ucode_buffer(struct ipr_sglist *sglist, buffer += bsize_elem) { struct page *page = sg_page(sg); - kaddr = kmap(page); - memcpy(kaddr, buffer, bsize_elem); - kunmap(page); - + memcpy_to_page(page, 0, buffer, bsize_elem); sg->length = bsize_elem; if (result != 0) { @@ -3938,10 +3934,7 @@ static int ipr_copy_ucode_buffer(struct ipr_sglist *sglist, if (len % bsize_elem) { struct page *page = sg_page(sg); - kaddr = kmap(page); - memcpy(kaddr, buffer, len % bsize_elem); - kunmap(page); - + memcpy_to_page(page, 0, buffer, len % bsize_elem); sg->length = len % bsize_elem; } -- 2.28.0.rc0.12.gb6a658bd00c9