summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/gaudi/gaudi.c
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2022-06-27 11:30:43 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-07-12 09:09:26 +0300
commit9c7fde71a7744a1934436397b1cb63460faf5c4c (patch)
tree01238f9c62e511bf0eba495b5f3106e39eeb8a79 /drivers/misc/habanalabs/gaudi/gaudi.c
parent0407c155f1a237f8f42b996d1a71088d462c494b (diff)
downloadlinux-9c7fde71a7744a1934436397b1cb63460faf5c4c.tar.gz
habanalabs: use %pa to print pci bar size
PCI bar size is resource_size_t so we should use %pa to make it work correctly on all architectures. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/gaudi/gaudi.c')
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 05d9817985d9..8fa0b86ccb6b 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -801,6 +801,7 @@ static int gaudi_early_init(struct hl_device *hdev)
{
struct asic_fixed_properties *prop = &hdev->asic_prop;
struct pci_dev *pdev = hdev->pdev;
+ resource_size_t pci_bar_size;
u32 fw_boot_status;
int rc;
@@ -811,24 +812,20 @@ static int gaudi_early_init(struct hl_device *hdev)
}
/* Check BAR sizes */
- if (pci_resource_len(pdev, SRAM_BAR_ID) != SRAM_BAR_SIZE) {
- dev_err(hdev->dev,
- "Not " HL_NAME "? BAR %d size %llu, expecting %llu\n",
- SRAM_BAR_ID,
- (unsigned long long) pci_resource_len(pdev,
- SRAM_BAR_ID),
- SRAM_BAR_SIZE);
+ pci_bar_size = pci_resource_len(pdev, SRAM_BAR_ID);
+
+ if (pci_bar_size != SRAM_BAR_SIZE) {
+ dev_err(hdev->dev, "Not " HL_NAME "? BAR %d size %pa, expecting %llu\n",
+ SRAM_BAR_ID, &pci_bar_size, SRAM_BAR_SIZE);
rc = -ENODEV;
goto free_queue_props;
}
- if (pci_resource_len(pdev, CFG_BAR_ID) != CFG_BAR_SIZE) {
- dev_err(hdev->dev,
- "Not " HL_NAME "? BAR %d size %llu, expecting %llu\n",
- CFG_BAR_ID,
- (unsigned long long) pci_resource_len(pdev,
- CFG_BAR_ID),
- CFG_BAR_SIZE);
+ pci_bar_size = pci_resource_len(pdev, CFG_BAR_ID);
+
+ if (pci_bar_size != CFG_BAR_SIZE) {
+ dev_err(hdev->dev, "Not " HL_NAME "? BAR %d size %pa, expecting %llu\n",
+ CFG_BAR_ID, &pci_bar_size, CFG_BAR_SIZE);
rc = -ENODEV;
goto free_queue_props;
}