mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
RDMA/amso1100: use offset_in_page macro
Use offset_in_page macro instead of (addr & ~PAGE_MASK). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e1ab75dd62
commit
0bc2763f56
2 changed files with 2 additions and 2 deletions
|
@ -131,7 +131,7 @@ void c2_free_mqsp(__be16 *mqsp)
|
|||
*mqsp = (__force __be16) head->head;
|
||||
|
||||
/* Compute the shared_ptr index */
|
||||
idx = ((unsigned long) mqsp & ~PAGE_MASK) >> 1;
|
||||
idx = (offset_in_page(mqsp)) >> 1;
|
||||
idx -= (unsigned long) &(((struct sp_chunk *) 0)->shared_ptr[0]) >> 1;
|
||||
|
||||
/* Point this index at the head */
|
||||
|
|
|
@ -359,7 +359,7 @@ static struct ib_mr *c2_reg_phys_mr(struct ib_pd *ib_pd,
|
|||
|
||||
for (i = 0; i < num_phys_buf; i++) {
|
||||
|
||||
if (buffer_list[i].addr & ~PAGE_MASK) {
|
||||
if (offset_in_page(buffer_list[i].addr)) {
|
||||
pr_debug("Unaligned Memory Buffer: 0x%x\n",
|
||||
(unsigned int) buffer_list[i].addr);
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
|
Loading…
Reference in a new issue