Re: [PATCH] kernel: events: use offset_in_page macro

From: Peter Zijlstra
Date: Tue Jun 30 2020 - 03:50:39 EST


On Tue, Jun 30, 2020 at 07:42:58AM +0000, Chen Ni wrote:

> Use offset_in_page macro instead of (addr & ~PAGE_MASK).

Shees, so now we're replacing a trivial expression with something that's
actually longer to type? How does that make sense?

> - memcpy(dst, kaddr + (vaddr & ~PAGE_MASK), len);
> + memcpy(dst, kaddr + offset_in_page(vaddr), len);