aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel/iommu.c
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-07-01 05:54:25 -0700
committerYury Norov <yury.norov@gmail.com>2022-07-15 06:35:54 -0700
commit4dea97f8636d0514befc9fc5cf342b351b7d0e20 (patch)
tree229c6eb22cd7c99bbe8d942a8f1b84465199a2fa /drivers/iommu/intel/iommu.c
parentlib/bitmap: change return types to bool where appropriate (diff)
downloadlinux-dev-4dea97f8636d0514befc9fc5cf342b351b7d0e20.tar.xz
linux-dev-4dea97f8636d0514befc9fc5cf342b351b7d0e20.zip
lib/bitmap: change type of bitmap_weight to unsigned long
bitmap_weight() doesn't return negative values, so change it's type to unsigned long. It may help compiler to generate better code and catch bugs. Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'drivers/iommu/intel/iommu.c')
-rw-r--r--drivers/iommu/intel/iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 44016594831d..2f1b09f34706 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -3946,7 +3946,7 @@ static ssize_t domains_used_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct intel_iommu *iommu = dev_to_intel_iommu(dev);
- return sprintf(buf, "%d\n", bitmap_weight(iommu->domain_ids,
+ return sprintf(buf, "%ld\n", bitmap_weight(iommu->domain_ids,
cap_ndoms(iommu->cap)));
}
static DEVICE_ATTR_RO(domains_used);