Skip to content

Commit

Permalink
xen/scsifront: use offset_in_page() macro
Browse files Browse the repository at this point in the history
Use offset_in_page() macro instead of open-coding.

Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
geliangtang authored and jgross1 committed May 2, 2017
1 parent d5ff506 commit 6483e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/xen-scsifront.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6483e31

Please sign in to comment.