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 25D14C2C9; Sun, 3 Aug 2025 19:37:18 +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=1754249840; cv=none; b=ue8fKurXUlHHwpz/KFwL1VUdTUdxk31htz3KJ2LiCdE9KQnWPRK0P2+/Vhwng4sx4Pncd99VtSYcx3DmjP8dzNzTiQIMsr4/WeezipbeIuY8IZZpj0go9bmd0DImeFyMehjnoa0DkSnPtldOBZDftzE/OXOUVDfDG1L9D2DppLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754249840; c=relaxed/simple; bh=7Ju8EZEaySWefzeVfXBR25v/1hG4k5/G/1h3M7aC3NU=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=CdFLdR/OjBymejy3LkaX6gUnfvbKtuJeoQC7jJlJnbjRw0MGT/AL23bQw12L/7d8Fo6q2sTmmLYdhYtT1jfFAprBBOkw1Njpu3UR4BC/movlniOwFFprEVd0VVkgk8zkvKmqNc8eB/PuG8Mmo3L73xRnPGYQR+yEZv/YPA9y22E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oPUk4mjW; 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="oPUk4mjW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A51E3C4CEEB; Sun, 3 Aug 2025 19:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754249838; bh=7Ju8EZEaySWefzeVfXBR25v/1hG4k5/G/1h3M7aC3NU=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=oPUk4mjWAaAX3gV1CfTtH3KYYOXZZISE/uw1PR9veTKk80Pg1RmvWCwn1Ex2Absvc jaisBysJTnE+IrHUswvr3hh4M7HHzaAO8yniXOVVAWS0VSNfghA67xS1lRDe1MCA8y VJKrAr5K+uqTsavrIeerxaHeAYsKUERgdxfBr5gHw3dnhpynlUMAZgZ/K5WHden5Ud VQcKL03ZR7+KCar8n0a0yp2ZkSfmOSgZaXULk7+BMJ2tJ7jRPKp4hLhOieMcIcS9aa vOw+0nX9+BdCJM5Rxg7gmEoF5YibNqLQQye1xe543Ee1cE9hmUQwDdRnUxC3JykfZf TCBhqkThubHSQ== 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, 03 Aug 2025 21:37:14 +0200 Message-Id: Subject: Re: [PATCH] rust: kernel: add missing safety comments From: "Benno Lossin" To: "Jinheng LI" , , Cc: , , , , , , X-Mailer: aerc 0.20.1 References: In-Reply-To: On Sun Aug 3, 2025 at 7:10 PM CEST, Jinheng LI wrote: > diff --git a/rust/kernel/list.rs b/rust/kernel/list.rs > index c391c30b80f8..b9dbb73a7ebe 100644 > --- a/rust/kernel/list.rs > +++ b/rust/kernel/list.rs > @@ -456,7 +456,10 @@ pub fn pop_front(&mut self) -> Option= > { > /// > /// `item` must not be in a different linked list (with the same id). > pub unsafe fn remove(&mut self, item: &T) -> Option> { > - // SAFETY: TODO. > + // SAFETY: The caller guarantees that `item` is not in a > different linked list with the This looks like your email client wrapped the diff, please take a look at [1] and perform the necessary steps for your email client. Otherwise it won't be easy to apply your patch. [1]: https://docs.kernel.org/process/email-clients.html --- Cheers, Benno > + // same ID. Since we have a mutable reference to the list, we > have exclusive access to all