On 06.06.24 20:11, Mathias Krause wrote: > + /* > + * KVM tracks vCPU IDs as 'int', be kind to userspace and reject > + * too-large values instead of silently truncating. > + * > + * Also ensure we're not breaking this assumption by accidentally > + * pushing KVM_MAX_VCPU_IDS above INT_MAX. > + */ > + BUILD_BUG_ON(KVM_MAX_VCPU_IDS > INT_MAX); And yes, I'd rather like to write the above as something like below to account for type changes: BUILD_BUG_ON(KVM_MAX_VCPU_IDS > typeof(vcpu->vcpu_id)::max()); But, unfortunately, C is not there yet. One could try to implement something based on _Generic() but, meh.. > if (id >= KVM_MAX_VCPU_IDS) > return -EINVAL; >