From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 6C5BE242918; Tue, 25 Mar 2025 20:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742934560; cv=none; b=WQPmklB2rtMjm1/IZYwo1TeQXEg5qcbZ4fcyPCYbPdD6EyTQoW1pm5tpXHqx/1QHvoZzUeKac0GVYYesmVW2uH5+DgGOZND6+Me0aeEtk5NPsQ2MDDcvsxaPtUkwx/ns+O5xD4Rmn2ek0nduTJl3pQiqs5AJogY+xQlfY390xuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742934560; c=relaxed/simple; bh=NsitWpF5+dUl6XB3pC20OcXtL3Kh1Nr2StHOUU26Rww=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hcQgQdy8RdMfRFJqUTFZPRexG+lQqj69lxxpy1NBdwQp4vfHE4s/qftaJCtlXS4s22pfnCPK/dfynIPnumVllTL6bfHr0JqSrwj3eAz4uLURu9IUtvOmJXNmo6OaDMgwg6GmGi0Tg8kH3IXBAcAsyGQZ1xBwz7xXy0e2Vt9OzEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=NoDVDhB0; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="NoDVDhB0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1742934549; x=1743193749; bh=fTPMqJdkIWV8h1b6QmmqOOGLsg9Vu94+5wCbSBo1U7M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=NoDVDhB0CCmupcRCAvZNSH3l1aD/WNyg9Mg4ubXTk2x9A1WwphRRcBy/NfuIy7beH 5xdp33WpCl5Len7Jvp4qcFppKQ9WTY+A7MuM3oOrTENvmDD+q+XmxJbVVtnCk6OPe0 JXSZgIjTnagLUB5xZiH/xReFA5Up4rHcSiXJgHZ/gbo81dZg+KdsuxY/MyAkhFNHCV 1iW0Q5kvL0EtnlXmT5navgKbHpRNYjA9xcIP2bV1bvcya2U1olC2W/5hDzEDJ02onQ C5Z5jApw9fbSAEaureo70Wul/jT2ZXBjleb8MB+1vDPK/kREjQRv2ktHjxndOedxe/ s1gEN5loBVDvg== Date: Tue, 25 Mar 2025 20:29:01 +0000 To: Tamir Duberstein From: Benno Lossin Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Greg Kroah-Hartman , "Rafael J. Wysocki" , Brendan Higgins , David Gow , Rae Moar , Bjorn Helgaas , Luis Chamberlain , Russ Weight , Rob Herring , Saravana Kannan , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-pci@vger.kernel.org, linux-block@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 0/6] rust: reduce pointer casts, enable related lints Message-ID: In-Reply-To: References: <20250317-ptr-as-ptr-v5-0-5b5f21fa230a@gmail.com> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 3bb29e99a5a636aa3b2a32b49e8de7a3d3efd080 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue Mar 25, 2025 at 6:17 PM CET, Tamir Duberstein wrote: > On Tue, Mar 25, 2025 at 11:33=E2=80=AFAM Benno Lossin wrote: >> On Tue Mar 25, 2025 at 2:34 PM CET, Tamir Duberstein wrote: >> > On Tue, Mar 25, 2025 at 7:05=E2=80=AFAM Benno Lossin wrote: >> >> On Mon Mar 24, 2025 at 10:59 PM CET, Tamir Duberstein wrote: >> >> > On Mon, Mar 24, 2025 at 5:55=E2=80=AFPM Benno Lossin wrote: >> >> >> On Mon Mar 24, 2025 at 9:55 PM CET, Tamir Duberstein wrote: >> >> >> > On Mon, Mar 24, 2025 at 4:16=E2=80=AFPM Benno Lossin wrote: >> >> >> >> I'll leave it up to you what you want to do with this: add it t= o this >> >> >> >> series, make a new one, or let someone else handle it. If you d= on't want >> >> >> >> to handle it, let me know, then I'll create a good-first-issue = :) >> >> >> > >> >> >> > I'll add a patch for `cast_lossless` -- the rest should probably= go >> >> >> > into an issue. >> >> >> >> >> >> Do you mind filing the issue? Then you can decide yourself what yo= u want >> >> >> to do yourself vs what you want to leave for others. Feel free to = copy >> >> >> from my mail summary. >> >> > >> >> > Well, I don't really know what's left to do. We're pretty close at >> >> > this point to having enabled everything but the nukes. Then there's >> >> > the strict provenance thing, which I suppose we can write down. >> >> >> >> Yes, but there are also these from my original mail: >> >> * `shared_ref as *const _` (for example in rust/kernel/uaccess.rs:247= , >> >> rust/kernel/str.rs:32 and rust/kernel/fs/file.rs:367), these we can >> >> replace with `let ptr: *const ... =3D shared_ref;`. Don't know if t= here >> >> is a clippy lint for this. >> > >> > I don't think we should go fixing things for which we don't have a >> > clippy lint. That way lies madness, particularly as patches begin to >> > be carried by other trees. >> >> There already exists a lint for that: `clippy::ref_as_ptr` (almost >> created an issue asking for one :) > > =F0=9F=AB=A1 picked this one up as well. Sniped yet again :) Thanks a lot for adding this one as well. >> Here is another lint that we probably want to enable (after the `&raw >> {const,mut}` series lands): `clippy::borrow_as_ptr`. > > This sounds like a good one to file. Since `raw_ref_op` is already enabled in rust-next, I just filed it: https://github.com/Rust-for-Linux/linux/issues/1152 --- Cheers, Benno