On Sat, Jan 21, 2023 at 12:05:58AM -0800, Ira Weiny wrote: > First, arn't PAGE_ALIGN_DOWN(addr) and PTR_ALIGN_DOWN(addr, PAGE_SIZE) the > same? > > align.h > #define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a))) > > mm.h: > #define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE) ... and ALIGN_DOWN ends up with doing bitwise and on the first argument. Which doesn't work for pointers, thus the separate variant for those and typecast to unsigned long in it...