xen/scsifront: use offset_in_page() macro
authorGeliang Tang <geliangtang@gmail.com>
Sat, 22 Apr 2017 01:21:13 +0000 (09:21 +0800)
committerJuergen Gross <jgross@suse.com>
Tue, 2 May 2017 09:14:53 +0000 (11:14 +0200)
Use offset_in_page() macro instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/scsi/xen-scsifront.c

index 9aa1fe1fc93967109256690be004d31fa04b52e7..a6a8b60d4902ab018442ab41acb99a9369c63146 100644 (file)
@@ -434,7 +434,7 @@ static int map_data_for_request(struct vscsifrnt_info *info,
 
        if (seg_grants) {
                page = virt_to_page(seg);
-               off = (unsigned long)seg & ~PAGE_MASK;
+               off = offset_in_page(seg);
                len = sizeof(struct scsiif_request_segment) * data_grants;
                while (len > 0) {
                        bytes = min_t(unsigned int, len, PAGE_SIZE - off);