From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 C6AAB30FC04 for ; Wed, 15 Oct 2025 19:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760556316; cv=none; b=M2It05W/YEavzytsv/Bw0PyKhuUQA8XYaoBUoJW1ZxQ5+/YmuvQWYQXJM0efS7Y6V6NOb6TOzRr5E4epphjjKVdpYgVsmeMUgtxs5egQEF3v00OC41PP3nfiBFh+MTrQiUZNwxfR1ychqGPPtb9oF8XT4TnmPNuMrafqOauMgs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760556316; c=relaxed/simple; bh=1C7R0OlcDfzCrDNlHP23bsVD6WxFN5roYyk953BnBNs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GalvdCw/uTmqgdwh5IDawnpORBTPr6JMaPNJXVBMWa0tGuto2TlnX3g6mBu2j7GfUZBRrZ9RiZAcGL5+UEhfEkrTBDGSSJ+2zsVL9TNEcTwqL7bWoqk1w/3Ps9pdgdcESHZ+a9JgvaLkNzraO/x+tUIuqY0CSkRc9zn2omjT0M0= 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.47 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-f47.google.com with SMTP id 6a1803df08f44-78f58f4230cso80726256d6.1 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=K/P3T5KMK61vkfWfa4YNXeXUo3nHmiefccrepGEd0RlOS85uD3Bdudr9AjQNtbwWZ3 iZRuhdcjO9WE82iQgFb94UYtroB7yPoZwwaN1deN5iOeKDYl30NHZiuCbXn6iCFdr++j /QzhnfRznl4mFU0VaC6Q6NEIm7QBAJ1EyxDPidvVr8VoD7ulU69EyY/DN1v3n2nhKn9V n1tDSUFCwnskFpkEW9jbDkHJ3kWsxoevqD5mQ98fbHwI31u2Bs+URCTvMiBHq9y2m1OF cw46hKdgW8IYkR2XbYM6fr90d/1gO9bwVgoGFwBvJDiOlvhcnvYUe0FuwfrpdYWkjjCf fR+w== X-Gm-Message-State: AOJu0YxaQyuNNHW2Qk0xhxbmytaIKMDIp7W+ziYi6CpsOMacZzfNlpQ8 LBMbjIxXZoM4YSOAmg4nRrH4xjqf/3cr/6F1PgNl9PyB6LS0PKFYF4ydBJn5ydk9 X-Gm-Gg: ASbGnctyQGcnOINQEJdsyqFOTPKzRku5hRgmKsobWWC3h9be7G/gmhPby5cKRetEGQY vGR+PQ48uEuv/Lb1ji/QUaAhNDfTnyaOwESscL8DeG0l8yiUIUtZ4okLvtuDl0MBawb+slBz02f 6JfNUNcxHNN47RixnIP3yIov4y3HbE3ziGxofipEe0igD9FG/MxTbYfwdU1kPtCOoacsJXiK/W1 H0b/IKWLvs2eoK/401KRrShalLOxO1VazoO5xu+Hiq0rYGpzNrrC8wlKzuXWibQiZmm9TshdJkJ oH7IIXg9LbcFAB4JB9xx3PkrIlisnuCXr+k/nE8YneccSslLMNDRgnSPMOlC9lcopWPiVgONcsD eovXEe5prXnk0yiTvGVCyf3GMo+Evqdsgqmt63yEXEVp5ytbfMaqPRI64xSmTOtI6BdahfmGZvD AYHaf18i0vmUXGhPi+lt3MA2aEhFlRXt5lCP0sD90JEzWLk8Pp0LQ27nQKDoXETgzpMnPulWGP6 JbzgfWuaFjXt58bGFQyhcywPaACedAFRlohkjjdQKBwSlrPqDy4PJ01id7lxZE= 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: rust-for-linux@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