Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628716
| From | Geliang Tang <geliangtang@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] xen/scsifront: use offset_in_page() macro |
| Date | 2017-04-22 03:30 +0200 |
| Message-ID | <tyS26-4Ml-9@gated-at.bofh.it> (permalink) |
| References | <tyS26-4Ml-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use offset_in_page() macro instead of open-coding.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
drivers/scsi/xen-scsifront.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 9aa1fe1..a6a8b60 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -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);
--
2.9.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] xen/scsifront: use offset_in_page() macro Geliang Tang <geliangtang@gmail.com> - 2017-04-22 03:30 +0200 Re: [PATCH] xen/scsifront: use offset_in_page() macro Juergen Gross <jgross@suse.com> - 2017-04-24 07:10 +0200
csiph-web