Re: [PATCH v8 2/2] platform: Add initial synology microp driver
From: FUJITA Tomonori
Date: Wed Apr 22 2026 - 09:54:07 EST
On Tue, 21 Apr 2026 20:46:59 +0200
Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> On Tue, Apr 21, 2026 at 8:21 PM Markus Probst <markus.probst@xxxxxxxxx> wrote:
>>
>> Delta stores it in nano seconds, so it will require an additional
>> `.as_millis()` call on use. I assume rust will optimize that out, so it
>> will be fine. I will use the `Delta` type like Miguel suggested in the
>> next revision.
>
> I think it should (at least in the 64-bit case -- we do have a
> `bindings::` C call in the 32-bit case, so likely not in that case),
> but please double-check the codegen.
>
> In any case, my suggestion wasn't necessarily about using `Delta`,
> which is definitely an option to consider, but rather more generally
> about using newtypes, e.g. it may be that we want to have a few simple
> time unit types (probably with support for `const`) for cases like
> these if people are going to use primitives everywhere to define their
> `const`s -- Cc'ing the timekeeping Rust folks.
Currently, Msecs is a type alias, so it provides no type safety, and
it has no users in the kernel. I think we should remove it.
I think that Delta works fine for BLINK_DELAY. On 32-bit there is a
small overhead in as_millis(), but I don't think that will be a
problem significant enough to justify introducing new types.