intel_iommu: fix and simplify size calculation in process_device_iotlb_desc()
commit04eb6247eb1d95728b1e3e0078ba79f5b6d2ac25
authorJason Wang <jasowang@redhat.com>
Fri, 20 Jan 2017 06:35:28 +0000 (20 14:35 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 1 Feb 2017 01:37:17 +0000 (1 03:37 +0200)
tree3f4b8cc82f5fc3ebbfe852b9e06e16a8f8c421b4
parentec42813028d9ede3f9f73b8c943b00ff235ba0c1
intel_iommu: fix and simplify size calculation in process_device_iotlb_desc()

We don't use 1ULL which is wrong during size calculation. Fix it, and
while at it, switch to use cto64() and adds a comments to make it
simpler and easier to be understood.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/intel_iommu.c