Commit 6483e313 authored by Geliang Tang's avatar Geliang Tang Committed by Juergen Gross

xen/scsifront: use offset_in_page() macro

Use offset_in_page() macro instead of open-coding.
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent d5ff5061
...@@ -434,7 +434,7 @@ static int map_data_for_request(struct vscsifrnt_info *info, ...@@ -434,7 +434,7 @@ static int map_data_for_request(struct vscsifrnt_info *info,
if (seg_grants) { if (seg_grants) {
page = virt_to_page(seg); page = virt_to_page(seg);
off = (unsigned long)seg & ~PAGE_MASK; off = offset_in_page(seg);
len = sizeof(struct scsiif_request_segment) * data_grants; len = sizeof(struct scsiif_request_segment) * data_grants;
while (len > 0) { while (len > 0) {
bytes = min_t(unsigned int, len, PAGE_SIZE - off); bytes = min_t(unsigned int, len, PAGE_SIZE - off);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment