diff mbox

xen/scsifront: use offset_in_page() macro

Message ID b066ac954374a00bca91fadf3f2d5aba0eb8cb0a.1492758340.git.geliangtang@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Geliang Tang April 22, 2017, 1:21 a.m. UTC
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(-)

Comments

Jürgen Groß April 24, 2017, 5:05 a.m. UTC | #1
On 22/04/17 03:21, Geliang Tang wrote:
> Use offset_in_page() macro instead of open-coding.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Thanks,

Juergen
Martin K. Petersen April 24, 2017, 10:15 p.m. UTC | #2
Juergen,

> On 22/04/17 03:21, Geliang Tang wrote:
>> Use offset_in_page() macro instead of open-coding.
>> 
>> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
>
> Reviewed-by: Juergen Gross <jgross@suse.com>

Taking this through the Xen tree or should I queue it?
Jürgen Groß April 25, 2017, 5:07 a.m. UTC | #3
On 25/04/17 00:15, Martin K. Petersen wrote:
> 
> Juergen,
> 
>> On 22/04/17 03:21, Geliang Tang wrote:
>>> Use offset_in_page() macro instead of open-coding.
>>>
>>> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
>>
>> Reviewed-by: Juergen Gross <jgross@suse.com>
> 
> Taking this through the Xen tree or should I queue it?

I can take it through the Xen tree.


Thanks,

Juergen
Jürgen Groß April 25, 2017, 6:58 a.m. UTC | #4
On 22/04/17 03:21, Geliang Tang wrote:
> Use offset_in_page() macro instead of open-coding.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

Pushed to xen/tip for-linus-4.12


Thanks,

Juergen
diff mbox

Patch

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);