public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail•com>
Cc: Tamir Duberstein <tamird@gmail•com>,
	Igor Korotin <igor.korotin.linux@gmail•com>,
	Miguel Ojeda <ojeda@kernel•org>, Greg KH <greg@kroah•com>,
	Danilo Krummrich <dakr@kernel•org>,
	"Rafael J. Wysocki" <rafael@kernel•org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: Re: linux-next: manual merge of the rust tree with the driver-core tree
Date: Fri, 21 Nov 2025 15:39:06 +1100	[thread overview]
Message-ID: <20251121153906.1d306ad1@canb.auug.org.au> (raw)
In-Reply-To: <CAJ-ks9=LxO8zTy7rQCiXrZGuwwN5d0gqVkQVE_S2QZnXTdu-Ug@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

Hi all,

On Thu, 20 Nov 2025 06:27:13 -0500 Tamir Duberstein <tamird@gmail•com> wrote:
>
> On Thu, Nov 20, 2025 at 4:15 AM Miguel Ojeda <miguel.ojeda.sandonis@gmail•com> wrote:
> >
> > On Thu, Nov 20, 2025 at 8:11 AM Stephen Rothwell <sfr@canb•auug.org.au> wrote:  
> > >
> > > I have applied the following (hack) merge resolution for today.  
> >
> > Thanks a lot Stephen for taking the time to do that instead of dropping it.
> >
> > We should be able to do the same as Tamir did in commit 657403637f7d
> > ("rust: acpi: use `core::ffi::CStr` method names"), i.e. move the
> > build assert below to then be able to use `len()` instead:
> >
> > diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs
> > index aea1b44d189b..f67c355c988e 100644
> > --- a/rust/kernel/i2c.rs
> > +++ b/rust/kernel/i2c.rs
> > @@ -43,11 +43,8 @@ impl DeviceId {
> >      /// Create a new device id from an I2C 'id' string.
> >      #[inline(always)]
> >      pub const fn new(id: &'static CStr) -> Self {
> > -        build_assert!(
> > -            id.len_with_nul() <= Self::I2C_NAME_SIZE,
> > -            "ID exceeds 20 bytes"
> > -        );
> > -        let src = id.as_bytes_with_nul();
> > +        let src = id.to_bytes_with_nul();
> > +        build_assert!(src.len() <= Self::I2C_NAME_SIZE, "ID exceeds 20 bytes");
> >          let mut i2c: bindings::i2c_device_id = pin_init::zeroed();
> >          let mut i = 0;
> >          while i < src.len() {
> > @@ -433,11 +430,8 @@ impl I2cBoardInfo {
> >      /// Create a new [`I2cBoardInfo`] for a kernel driver.
> >      #[inline(always)]
> >      pub const fn new(type_: &'static CStr, addr: u16) -> Self {
> > -        build_assert!(
> > -            type_.len_with_nul() <= Self::I2C_TYPE_SIZE,
> > -            "Type exceeds 20 bytes"
> > -        );
> > -        let src = type_.as_bytes_with_nul();
> > +        let src = type_.to_bytes_with_nul();
> > +        build_assert!(src.len() <= Self::I2C_TYPE_SIZE, "Type exceeds
> > 20 bytes");
> >          let mut i2c_board_info: bindings::i2c_board_info = pin_init::zeroed();
> >          let mut i: usize = 0;
> >          while i < src.len() {
> >
> > Igor/Tamir?  
> 
> Yep, looks correct to me!

OK, I have used that from today.

Could that fix just be applied to the driver-core tree now?  Or does it
depend on changes in the rust tree?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-11-21  4:39 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  7:11 linux-next: manual merge of the rust tree with the driver-core tree Stephen Rothwell
2025-11-20  9:15 ` Miguel Ojeda
2025-11-20 11:27   ` Tamir Duberstein
2025-11-21  4:39     ` Stephen Rothwell [this message]
2025-11-21 12:16       ` Tamir Duberstein
2025-11-21 15:56         ` Miguel Ojeda
2025-11-21 16:07           ` Greg KH
2025-11-23 16:39             ` Miguel Ojeda
2025-11-21 19:21           ` Danilo Krummrich
  -- strict thread matches above, loose matches on Subject: below --
2025-11-14  4:18 Stephen Rothwell
2025-12-05  3:23 ` Stephen Rothwell
2025-11-10  1:31 Stephen Rothwell
2025-11-10  1:24 Stephen Rothwell
2025-12-05  3:22 ` Stephen Rothwell
2025-09-23 16:44 Mark Brown
2025-09-23 16:49 ` Danilo Krummrich
2025-09-23 19:24   ` Miguel Ojeda
2025-09-24  8:04     ` Mark Brown
2025-09-24  8:25       ` Miguel Ojeda
2025-09-16 13:27 Mark Brown
2025-07-23  1:26 Stephen Rothwell
2025-07-23 12:49 ` Miguel Ojeda
2025-07-21  4:25 Stephen Rothwell
2025-07-21  8:24 ` Miguel Ojeda
2025-07-18 11:01 Stephen Rothwell
2025-07-18 10:46 Stephen Rothwell
2025-07-18 16:43 ` Danilo Krummrich
2025-07-18 10:26 Stephen Rothwell
2025-07-18 10:47 ` Stephen Rothwell
2025-07-15  8:26 Stephen Rothwell
2025-07-15  8:21 Stephen Rothwell
2025-07-11  8:04 Stephen Rothwell
2025-07-11  9:27 ` Tamir Duberstein
2025-07-11  7:59 Stephen Rothwell
2025-07-11  9:48 ` Miguel Ojeda
2025-07-01  7:46 Stephen Rothwell
2025-07-01  9:12 ` Miguel Ojeda
2025-03-21  7:56 Stephen Rothwell
2025-03-21 20:54 ` Miguel Ojeda
2025-04-01  3:21 ` Stephen Rothwell
2025-04-01  7:42   ` Greg KH
2025-01-14  4:46 Stephen Rothwell
2025-01-14  8:39 ` Miguel Ojeda
2025-01-23  3:30 ` Stephen Rothwell
2025-01-14  4:37 Stephen Rothwell
2025-01-14  8:38 ` Miguel Ojeda
2025-01-23  3:28 ` Stephen Rothwell
2025-01-13  4:12 Stephen Rothwell
2025-01-13 11:13 ` Miguel Ojeda
2025-01-23  3:31 ` Stephen Rothwell
2024-12-17  3:09 Stephen Rothwell
2024-12-17  8:15 ` Greg KH
2024-12-18  0:18 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251121153906.1d306ad1@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=dakr@kernel$(echo .)org \
    --cc=greg@kroah$(echo .)com \
    --cc=igor.korotin.linux@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=miguel.ojeda.sandonis@gmail$(echo .)com \
    --cc=ojeda@kernel$(echo .)org \
    --cc=rafael@kernel$(echo .)org \
    --cc=tamird@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox