Re: [PATCH v2 4/4] ALSA: usb-audio: qcom: Use PAGE_ALIGN macro for buffer size calculation
From: Takashi Iwai
Date: Fri Jun 05 2026 - 07:15:28 EST
On Fri, 05 Jun 2026 05:16:11 +0200,
wangdich9700@xxxxxxx wrote:
>
> From: wangdicheng <wangdicheng@xxxxxxxxxx>
>
> Use the kernel's PAGE_ALIGN() macro instead of open-coding the page
> alignment calculation. This improves code readability and follows
> kernel coding style.
>
> The manual calculation:
> mult = len / PAGE_SIZE;
> remainder = len % PAGE_SIZE;
> len = mult * PAGE_SIZE;
> len += remainder ? PAGE_SIZE : 0;
>
> is equivalent to:
> len = PAGE_ALIGN(len);
>
> Signed-off-by: wangdicheng <wangdicheng@xxxxxxxxxx>
> ---
> v1->v2:
> Remove unused variables 'remainder' and 'mult' to fix W=1 build warnings
> reported by kernel test robot.
This has been already addressed on for-next branch.
thanks,
Takashi