hv: vtd: fix compile warning on UEFI platform

Fix compile warning on UEFI platform when check bus number.

Tracked-On: #2743
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
This commit is contained in:
Binbin Wu 2019-03-13 04:55:51 +00:00 committed by wenlingz
parent 0a9aeaa10e
commit 2ada1d4dbf

View File

@ -1059,10 +1059,11 @@ void destroy_iommu_domain(struct iommu_domain *domain)
int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
{
int32_t status = 0;
uint16_t local_bus = bus;
/* TODO: check if the device assigned */
if ((uint16_t)bus >= CONFIG_IOMMU_BUS_NUM) {
if (local_bus >= CONFIG_IOMMU_BUS_NUM) {
pr_err("bus 0x%x out of range", bus);
return -EINVAL;
}
@ -1080,8 +1081,9 @@ int32_t assign_iommu_device(struct iommu_domain *domain, uint8_t bus, uint8_t de
int32_t unassign_iommu_device(const struct iommu_domain *domain, uint8_t bus, uint8_t devfun)
{
int32_t status = 0;
uint16_t local_bus = bus;
if ((uint16_t)bus >= CONFIG_IOMMU_BUS_NUM) {
if (local_bus >= CONFIG_IOMMU_BUS_NUM) {
pr_err("bus 0x%x out of range", bus);
return -EINVAL;
}