On 04.09.2026 13:58, Oleksii Kurochko wrote:
> On 9/2/26 1:51 PM, Baptiste Le Duc wrote:
>>> +uint32_t aplic_msi_target_gen(const struct vcpu *target_vcpu,
>>> +                              uint32_t base_val)
>>> +{
>>> +    unsigned int guest_id = vcpu_guest_file_id(target_vcpu);
>>> +    unsigned long hart_field = aplic_hart_field(target_vcpu->processor);
>> Nit: could be const
> 
> Techically I agree. Then for guest_id it should const too, right?
> 
> But it seems like Xen in such cases don't use const. Have you found a 
> rule that we have to use const in such cases?
> 
> I don't mind to put const here but then it would be nice if someone will 
> tell me some kind of rule...

We want const on pointer targets whenever possible. We don't normally want
const on plain variables, unless it needs emphasizing that a variable is to
change value (which should be very rare).

Jan

Reply via email to