Yang, Sheng wrote:
> +
> +static int pit_get_out(struct kvm *kvm, int channel)
> +{
> +     struct kvm_kpit_channel_state *c =
> +             &kvm->arch.vpit->pit_state.channels[channel];
> +     s64 d, t;
> +     int out;
> +
> +     ASSERT(mutex_is_locked(&kvm->arch.vpit->pit_state.lock));
> +
> +     t = ktime_to_ns(ktime_sub(ktime_get(), c->count_load_time));
> +     d = muldiv64(t, PIT_FREQ, 1e9);
>   

NSECS_PER_SEC to avoid people jumping on you saying you can't use 
floating point in the kernel (yes, the compiler converts it at 
compile-time, but they'll still say it).

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to 
panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to