@@ -124,7 +124,7 @@ static void cf_check address_hi_write(
struct vpci_msi *msi = data;
/* Clear and update high part. */
- msi->address &= 0xffffffff;
+ msi->address = (uint32_t)msi->address;
msi->address |= (uint64_t)val << 32;
update_msi(pdev, msi);
@@ -531,7 +531,7 @@ static int cf_check msix_write(
case PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET:
entry->updated = true;
- entry->addr &= 0xffffffff;
+ entry->addr = (uint32_t)entry->addr;
entry->addr |= (uint64_t)data << 32;
break;
@@ -319,7 +319,7 @@ static void vpci_write_hw(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
static uint32_t merge_result(uint32_t data, uint32_t new, unsigned int size,
unsigned int offset)
{
- uint32_t mask = 0xffffffff >> (32 - 8 * size);
+ uint32_t mask = 0xffffffffU >> (32 - 8 * size);
return (data & ~(mask << (offset * 8))) | ((new & mask) << (offset * 8));
}
@@ -402,7 +402,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
data = merge_result(data, tmp_data, size - data_offset, data_offset);
}
- return data & (0xffffffff >> (32 - 8 * size));
+ return data & (0xffffffffU >> (32 - 8 * size));
}
/*
@@ -427,7 +427,7 @@ static void vpci_write_helper(const struct pci_dev *pdev,
data = merge_result(val, data, size, offset);
}
- r->write(pdev, r->offset, data & (0xffffffff >> (32 - 8 * r->size)),
+ r->write(pdev, r->offset, data & (0xffffffffU >> (32 - 8 * r->size)),
r->private);
}