On 03.02.2026 17:55, Oleksii Kurochko wrote:
> On 2/3/26 4:47 PM, Jan Beulich wrote:
>> On 22.01.2026 17:47, Oleksii Kurochko wrote:
>>> +void vtimer_set_timer(struct vtimer *t, const uint64_t ticks)
>>> +{
>>> +    struct arch_vcpu *avcpu = container_of(t, struct arch_vcpu, vtimer);
>>> +    struct vcpu *v = container_of(avcpu, struct vcpu, arch);
>> Why two container_of() when one will do? (Same again further down.)
> 
> I didn't think that container_of(t, struct vcpu, arch.vtimer) would work
> (as arch.vtimer is embedded inside struct vcpu. Is my assumption correct that
> if it was arch->vtimer then it won't work?)

Please simply go look at the container_of() definition.

Jan

Reply via email to