From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28B0E30EF88 for ; Sun, 17 May 2026 12:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779021294; cv=none; b=FaMbLW1SbRocqz9n4mdytDNKj40cFU5Yrh88wqTfofILUGJr+7PZgyMhUXr5Q6iJYeFNQphB5Iz21kghVk6OphfT5FeK0krzvLRRrR8/18xU+4dXDK82H/WGKTUC7xIrKlccE126hFtHBNvj4tz1iFEfRqahJpueDFgb2HZRTjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779021294; c=relaxed/simple; bh=wMMu1MoxZqJP7N9AiF97VStohM+BcG77XY+Mb+mr4Ow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F8HdAvmbBOu4utH+x/uHIcQ9f/KNxXegHDi9WdJpty5KqLqDUnGo2QjapnuPIR/N0xr6sT3DkN2B+s+yr0w9+JMFrhXMEfYOlscQ2kaMB1wCOYZZvlfC5g7EESv/J3xASrFTlNGz6hLKu+Tn4KIJ4bm8xfEtqV2et7m4Z0o0G/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=D4mCcZrE; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="D4mCcZrE" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779021290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IW9Thd3mJQUBbsTDo9HU+1EAUl3feGX5J6vER8Rm0Ho=; b=D4mCcZrEqanHckcYWGupS64JxLKoVFGHc7x+B1rtw4KHnaRFAvaFnJmMDFoioAg5A4CGl/ uwaUL7v0PSokXk6T8RO9Hpx0jnPz9nA+I/WaWSNdH5Kth4dF1mfjHmok+M3tg5avgYaJ05 Jf20iKvL3hYRbtGlJAinIf4q+F7gGvU= From: Thorsten Blum To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Yury Norov , Rasmus Villemoes , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Thorsten Blum Subject: [PATCH 2/3] mm: add bytes_to_page_end() helper Date: Sun, 17 May 2026 14:34:30 +0200 Message-ID: <20260517123428.1181981-5-thorsten.blum@linux.dev> In-Reply-To: <20260517123428.1181981-4-thorsten.blum@linux.dev> References: <20260517123428.1181981-4-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=675; i=thorsten.blum@linux.dev; h=from:subject; bh=wMMu1MoxZqJP7N9AiF97VStohM+BcG77XY+Mb+mr4Ow=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFmcW28GFa05q/H//lW7k2dMapocVtqKTLB2WOOTsZhX0 W+n0hXXjlIWBjEuBlkxRZYHs37M8C2tqdxkErETZg4rE8gQBi5OAZiIiwHDP6UzMpO7/m27o+mg dtDvmamCkpuGvUuc0l2pX5VGM873GTL8Zstb97/ulflqmU92HyTf8eRc2bBNbod/cPWc5+/ljx5 4zQoA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Add bytes_to_page_end() for the common PAGE_SIZE - offset_in_page() calculation. Suggested-by: Andy Shevchenko Signed-off-by: Thorsten Blum --- include/linux/page_helpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/page_helpers.h b/include/linux/page_helpers.h index 102a4f3c3868..981731faa1fc 100644 --- a/include/linux/page_helpers.h +++ b/include/linux/page_helpers.h @@ -6,5 +6,6 @@ #include #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) +#define bytes_to_page_end(p) (PAGE_SIZE - offset_in_page(p)) #endif /* _LINUX_PAGE_HELPERS_H */