From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D98692192F2; Sat, 16 Aug 2025 23:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755387888; cv=none; b=cG4nRZsGnIZaBx2V00yt1BFkmiYS3Hdq4yPmrgNnh+AdBiy8TrF9CPVu7It4nq9g8NJlQhsk1OKe76OHRm5iuZ0TSugx8wTIqz00pJNijrMo5hAy2l5csHHDNvH8YVQiH5Eveq9O4KgOw2Dv//jgBDfBFV8cL8MQzIW9eoFYPaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755387888; c=relaxed/simple; bh=Y2IR6l2xgHEwLKnQTmYLs6uvEGbn+JQI/rGwjQ/51pw=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=V8X/DW2QLzOHfBKnNtyeIFEbFJOURL/tsszxhREVcd073OK/556ABiFPz52naLHH5HPoZBToaKVWVShHUbVvl6ie87eEYkOUQ0ONeLYz1rUg5s4YUqBHUXh5Bu+LsFCxiXzyLNZX15Uzhd1LzZnauLAGo+mkdX944UM0PqLpnsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QlOSUaad; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QlOSUaad" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F91C4CEEF; Sat, 16 Aug 2025 23:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755387887; bh=Y2IR6l2xgHEwLKnQTmYLs6uvEGbn+JQI/rGwjQ/51pw=; h=Date:From:Subject:Cc:To:References:In-Reply-To:From; b=QlOSUaadKyFgKRVb2Cn92dQSeIR2FylNjXVpuV2hE1jnFOW0kDWQVOFWhhWJvkGsZ R8tQBGcrSZnsPNquiolfAslZiVBgKAbgIhFtt13sfsi4nwpT2WkpTC9NTNlBHRu1jo mEfCMqg/OmVMInxSFUV3DEgRTfe890VrWs8JPRC3ptYUsOT8i1QmDF3+IpvsEbWnB+ a3s7F/vHEBz+u025pi+Mnsa2s+Croe+50shAWTIOpl9K665tkp0j2kUklxr2XJ3tCA 4f8oEE1j6AqHqfxlPjIGZVC5mnEq2kaHEDFaAxCoKk7BJQ7ptNCZVRte+hXxeRPbZX v6ATu4mbrtvPw== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 17 Aug 2025 01:44:41 +0200 Message-Id: From: "Danilo Krummrich" Subject: Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout() Cc: , , , , , , , , , , , , , , , , , , , , To: "Miguel Ojeda" References: <20250731154919.4132-1-dakr@kernel.org> <20250731154919.4132-2-dakr@kernel.org> In-Reply-To: On Sat Aug 16, 2025 at 10:40 PM CEST, Miguel Ojeda wrote: > On Thu, Jul 31, 2025 at 5:49=E2=80=AFPM Danilo Krummrich wrote: >> >> +impl Kmalloc { >> + /// Returns a [`Layout`] that makes [`Kmalloc`] fulfill the request= ed size and alignment of >> + /// `layout`. >> + pub const fn aligned_layout(layout: Layout) -> Layout { > > I think this `const fn` here was removed when applying to make it work > with older compilers, right? Yes, that's correct. > I was fixing another `rusttest` thing and noticed while applying > these. I had a patch to fix it, since we can actually just use the > feature, and then I noticed it wasn't in the tree. Since I have it, I > am attaching it for reference in case the now-stable feature is > needed, e.g. if you want to make that `const fn` again. I think it doesn't add much value for this to be a const function anyways, = but maybe it is more useful elsewhere? In that case, I think it also doesn't hu= rt to Kmalloc::aligned_layout() const again.