Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B21E30FC1B for ; Wed, 15 Oct 2025 19:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760556318; cv=none; b=DyDsRAlWLJRphqi9pMDAm8ByZjWBOk3gFrln/g2KBMMfwZ3hGYU8dVl2IqxrVi5N9EZMukwJXrbR2gg02pLHgw9PYsVvA3GeF9aaddde2PVUjjYtmFUkfn/szWqZ2W/J8XY914EPDFhYX2C3LW2pnYeuL40usQEQrrvE/G6GfXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760556318; c=relaxed/simple; bh=1C7R0OlcDfzCrDNlHP23bsVD6WxFN5roYyk953BnBNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gscw7J6ITQ3hCoY05bWPtAiG2fov0WjsTK4M/HCVX4GpVDuT7OYbmMHVE8B9WqgeFflrxc7UIXKbJWc6RdVbByEpOu23aK016F4IWBi8r5LY1UEK6vBgjhISm5qQg0dWxE1JUgrMXglX/uhOLJgfNsthIxMK5d/gWDYwdUQ4hqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LvURDB2b; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LvURDB2b" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-7957e2f6ba8so92206026d6.3 for ; Wed, 15 Oct 2025 12:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760556313; x=1761161113; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gZKdkbczThzjFB/XasmnId0cLwQ4C+67cjGeOTOncUU=; b=LvURDB2bWmzmqc3ssvxSZ5e41cSaG+FYiEbdcfC9cY184Iz7xDLZ2mw3gltSKQZ6lt Gb8i4g746WVUeM/u5dyezFGSPw1rFoXL14Q5oDlX7uU6fkq1637nSqsSYL6PhKV+4Fb5 C7jZ2hBCCUC7DqzxJL+TtR7wO0b4MS0C3O8r8NW1qVBPjaP8aePXqbEXCaW75xJ8XJRY 4+Yk/GVU24t25jo3GQ3Im4KSPqtg+3pHWmCjVvktEnpWEuHY+NT3WiXN9H+vAukTqkTw EhC1pibdM7mdZGBixA6HOy4B3TKHjcSOBgPSHuHjwhoOEeXIVeB9f+BQ5AP5SBAWmR64 vIKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760556313; x=1761161113; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gZKdkbczThzjFB/XasmnId0cLwQ4C+67cjGeOTOncUU=; b=A0Ijt3LVwsrHUWDMsIJdjQxBzFskqBJzHhhN+fiUqKmWHfSS11XwQcBldf54r2+d9I VRC7wAHdgk7ZtkafTl0mBhPqrCSiFTCzPxR7OhuYXFbWfzSiodTw1Yt8NiOCb0iWXVqS +bXgIoM/K5BsnWYjO3YDJspzqVBAOCqNmGisny3w2x09e3KC3FFfsYYZlEUbi6Zlf8XG HXxNGsJiLofnFu1QmxAQo2FqSPQWF6fjuPuqSBu/WQw+MTMAvRXpxc5Jz1Y3Uu0eh4cP nyn4chnIKk3DHrSvRTgxLHD2c87o7agwQwR2h336uMjNZhjAPJJkXyRxYC+pGoqLPIfo bldA== X-Forwarded-Encrypted: i=1; AJvYcCWI8HlWu9LEBwV2RFNKNthm3esmbQYKe4dUVP1mUjavS/stR31VL9A31rH2HDxVHjqKN3S1l7Q+1M5WPQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzzMRYjEowk/44RmFsb7+pAuFIql2kBi1Y24pWXXKwXmsLRoS8y 0t/nD+vkHVjHmWf0nU/0PJHpp1F14whs57hZthExBe1U7ihjSvmbOqsfQEH21urd X-Gm-Gg: ASbGncvJlZK4i5TNtcZn0ocJAdV++q//pMXtvcAmvj0156hFlCWMPBHj5eJbRBAW76J KPTMen9c+buGhIjxAFaWEY+kGEOhgeykpyPyDX0IVPvtvkICQZd/Y8C6uFnWw0HsVwuJhPiFnSQ vm2Oc5VOUH51IDYDyDV7fjkSMu5YLuVxOevZmb6cTI/2QmQgY2bFtMbK41rmlbzfHMRSiauaser a26gVvBHs6e1KpKSTNdwj6WttmFTF2896Yw29mdz51K22SakSaHvaRRt5NFttKZHNX1DzLH9Fmp aZOelvgnzsqHnxvwMdbU541uOZeHYLp/dl7MYE5NLlQUWyRDMdNyvT/GmgS9+x/+fDwDudORl4N MZVNisVKtgYnt1e8Rw0O7OFREbAU8V7vy0LBED5UkkoTmenXMRkiUn6KA0eX+Jp1UUVO1poCbEo t33p0P8NAP2XhHKV43JPRAfe7KDpKiNHHu6OrLN86wNzJapdijQjyv5E/AkZpKwbdnrwLLNRpbw 4ypDndzzmHqQsPsVl89rNp2FCc5LVppsN00fnSsohXFh9w+4I0sUX2ExXVNcdk= X-Google-Smtp-Source: AGHT+IG7liVg/dFGAXjOyaKmVuQjChyGkmShQ9JV9oLbo6kDusjiP3kvxzCrSASqCG/bT3aBHrC7KQ== X-Received: by 2002:a05:6214:da5:b0:81c:b934:a01 with SMTP id 6a1803df08f44-87b2efb9b5fmr472291556d6.31.1760556312957; Wed, 15 Oct 2025 12:25:12 -0700 (PDT) Received: from 136.1.168.192.in-addr.arpa ([2600:4808:6353:5c00:8573:f4c5:e7a9:9cd9]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-87c012b165asm24076996d6.59.2025.10.15.12.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 12:25:12 -0700 (PDT) From: Tamir Duberstein Date: Wed, 15 Oct 2025 15:24:36 -0400 Subject: [PATCH v17 06/11] rust: alloc: use `kernel::fmt` Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251015-cstr-core-v17-6-dc5e7aec870d@gmail.com> References: <20251015-cstr-core-v17-0-dc5e7aec870d@gmail.com> In-Reply-To: <20251015-cstr-core-v17-0-dc5e7aec870d@gmail.com> To: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Greg Kroah-Hartman , "Rafael J. Wysocki" , Luis Chamberlain , Russ Weight , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christian Brauner , Alexander Viro , Jan Kara , =?utf-8?q?Arve_Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Jens Axboe , Lorenzo Stoakes , Vlastimil Babka , "Liam R. Howlett" , Uladzislau Rezki , Bjorn Helgaas , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, Tamir Duberstein X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openssh-sha256; t=1760556295; l=1945; i=tamird@gmail.com; h=from:subject:message-id; bh=1C7R0OlcDfzCrDNlHP23bsVD6WxFN5roYyk953BnBNs=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgtYz36g7iDMSkY5K7Ab51ksGX7hJgs MRt+XVZTrIzMVIAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QDAN3p325daLL4ZjhjcTgzqClyBuzpHB1y4m1///5j/K+30qaqRH3Sgm2aqLHXCgT2ZR6uF5mJU hkiaomJhEowg= X-Developer-Key: i=tamird@gmail.com; a=openssh; fpr=SHA256:264rPmnnrb+ERkS7DDS3tuwqcJss/zevJRzoylqMsbc Reduce coupling to implementation details of the formatting machinery by avoiding direct use for `core`'s formatting traits and macros. This backslid in commit 9def0d0a2a1c ("rust: alloc: add Vec::push_within_capacity"). Signed-off-by: Tamir Duberstein --- rust/kernel/alloc/kvec/errors.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/kernel/alloc/kvec/errors.rs b/rust/kernel/alloc/kvec/errors.rs index 21a920a4b09b..e7de5049ee47 100644 --- a/rust/kernel/alloc/kvec/errors.rs +++ b/rust/kernel/alloc/kvec/errors.rs @@ -2,14 +2,14 @@ //! Errors for the [`Vec`] type. -use kernel::fmt::{self, Debug, Formatter}; +use kernel::fmt; use kernel::prelude::*; /// Error type for [`Vec::push_within_capacity`]. pub struct PushError(pub T); -impl Debug for PushError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { +impl fmt::Debug for PushError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Not enough capacity") } } @@ -25,8 +25,8 @@ fn from(_: PushError) -> Error { /// Error type for [`Vec::remove`]. pub struct RemoveError; -impl Debug for RemoveError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { +impl fmt::Debug for RemoveError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Index out of bounds") } } @@ -45,8 +45,8 @@ pub enum InsertError { OutOfCapacity(T), } -impl Debug for InsertError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { +impl fmt::Debug for InsertError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { InsertError::IndexOutOfBounds(_) => write!(f, "Index out of bounds"), InsertError::OutOfCapacity(_) => write!(f, "Not enough capacity"), -- 2.51.0