Re: [PATCH net-next v2 3/6] rust: time: Implement addition of Ktime and Delta

From: FUJITA Tomonori
Date: Wed Oct 09 2024 - 08:53:55 EST


On Mon, 7 Oct 2024 16:24:28 +0200
Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:

>> > or not (even if we still promise it is the same type underneath). It
>> > means having to define helpers, adding `unsafe` code and `SAFETY`
>> > comments, a call penalty in non-LTO, losing overflow checking (if we
>> > want it for these types), and so on.
>>
>> Yeah, if we are allowed to touch ktime_t directly instead of using the
>> accessors, it's great for the rust side.
>>
>> The timers maintainers, what do you think?
>
> We already do that in the existing code. The Ktime::sub method touches
> the ktime_t directly and performs a subtraction using the - operator
> rather than call a ktime_ method for it.

I'll touch ktime_t directly in the next version.