public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Onur <work@onurozkan.dev>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	daniel@sedlak.dev, dirk.behme@de.bosch.com, felipe_life@live.com,
	tamird@gmail.com, dakr@kernel.org, tmgross@umich.edu,
	aliceryhl@google.com, a.hindborg@kernel.org, lossin@kernel.org,
	bjorn3_gh@protonmail.com, gary@garyguo.net, boqun.feng@gmail.com,
	alex.gaynor@gmail.com, ojeda@kernel.org
Subject: Re: [PATCH v2 1/1] rust: refactor to_result to return the original value
Date: Tue, 9 Sep 2025 21:25:48 +0300	[thread overview]
Message-ID: <20250909212548.2e1aff9f@nimda.home> (raw)
In-Reply-To: <20250909204308.74ccedf4@nimda.home>

On Tue, 9 Sep 2025 20:43:08 +0300
Onur Özkan <work@onurozkan.dev> wrote:

> On Tue, 9 Sep 2025 19:17:56 +0200
> Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
> 
> > On Tue, Sep 9, 2025 at 7:01 PM Onur Özkan <work@onurozkan.dev>
> > wrote:
> > >
> > > This patch only fixes the callers that broke after the changes on
> > > `to_result`. I haven't included all the improvements made possible
> > > by the new design since
> > 
> > I think Daniel asked in the previous version what you mean by
> > "callers that broke" here -- it is a bit confusing, since it seems
> > this is a fix (and thus needs to be prioritized).
> > 
> > Is that the case?
> > 
> > Thanks!
> > 
> > Cheers,
> > Miguel
> 
> What I meant is that the change on `to_result` signature introduced a
> breaking change so I had to update its callers accordingly.
> 
> The fix I mentioned in this version is a different matter.
> 
> Before the rebase, the regulator module had a get_voltage function
> like this:
> 
> 	let voltage = unsafe {...};
> 
> 	if voltage < 0 {
>     		Err(...)
> 	} else {
>     		Ok(Voltage::from_microvolts(voltage))
> 	}
> 
> But on the regulator/for-next branch, a patch was applied that changed
> it to:
> 
> 	let voltage = unsafe {...};
> 	to_result(voltage).map(|()| Voltage::from_microvolts(voltage))
> 
> That change was incompatible with v1 (due to the different signature
> of to_result), which fails to build with my patch. This version (v2)
> fixes the issue introduced in v1.
> 
> Sorry for the confusion, I hope it's more clear now.
> 
> Thanks,
> Onur

If I am not mistaken the way I prepared v2 is also not correct. I guess
the fix for regulator/for-next should be a separate patch.

  reply	other threads:[~2025-09-09 18:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 17:00 [PATCH v2 0/1] rust: refactor to_result to return the original value Onur Özkan
2025-09-09 17:00 ` [PATCH v2 1/1] " Onur Özkan
2025-09-09 17:17   ` Miguel Ojeda
2025-09-09 17:43     ` Onur Özkan
2025-09-09 18:25       ` Onur [this message]
2025-09-09 18:25       ` Daniel Almeida
2025-09-09 18:53         ` Onur Özkan
2025-09-09 20:13           ` Daniel Almeida
2025-09-09 20:05       ` Miguel Ojeda
2025-09-09 20:12         ` Daniel Almeida
2025-09-09 20:25           ` Miguel Ojeda
2025-09-10  4:50         ` Onur Özkan
2025-09-10  6:26   ` Alice Ryhl
2025-09-10 10:58     ` Onur Özkan
2025-09-10 11:05       ` Alice Ryhl
2025-09-10 12:47         ` Onur Özkan
2025-09-10 12:50           ` Alice Ryhl
2025-09-10 12:55             ` Onur Özkan
2025-09-12  8:41   ` kernel test robot

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=20250909212548.2e1aff9f@nimda.home \
    --to=work@onurozkan.dev \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel@sedlak.dev \
    --cc=dirk.behme@de.bosch.com \
    --cc=felipe_life@live.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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