Commit 72a5f6a8 authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman
Browse files

staging: rdma: hfi1: Use offset_in_page macro



Use offset_in_page macro instead of (var & ~PAGE_MASK)

The Coccinelle semantic patch used to make this change is as follows:
// <smpl>
@@
unsigned long p;
@@
- p & ~PAGE_MASK
+ offset_in_page(p)
// </smpl>

Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 809487c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -925,8 +925,8 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
			unsigned pageidx, len;
			unsigned pageidx, len;


			base = (unsigned long)iovec->iov.iov_base;
			base = (unsigned long)iovec->iov.iov_base;
			offset = ((base + iovec->offset + iov_offset) &
			offset = offset_in_page(base + iovec->offset +
				  ~PAGE_MASK);
						iov_offset);
			pageidx = (((iovec->offset + iov_offset +
			pageidx = (((iovec->offset + iov_offset +
				     base) - (base & PAGE_MASK)) >> PAGE_SHIFT);
				     base) - (base & PAGE_MASK)) >> PAGE_SHIFT);
			len = offset + req->info.fragsize > PAGE_SIZE ?
			len = offset + req->info.fragsize > PAGE_SIZE ?