summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKoby Elbaz <kelbaz@habana.ai>2021-06-17 17:04:16 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-06-21 10:16:29 +0300
commit69dbbbadad4f579048d441c5472482601a306935 (patch)
tree7652fae20dcfe91b95f0f8144748ba9509277732 /drivers
parent23bace677a3d928b388b6204d64c08b8c6fd468c (diff)
habanalabs: get lower/upper 32 bits via masking
fix multiple similar occurrences of the following sparse warning: 'warning: cast truncates bits from constant value (7ffc113000 becomes fc113000)' Signed-off-by: Koby Elbaz <kelbaz@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c2
-rw-r--r--drivers/misc/habanalabs/goya/goya.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index be830948e051..4a75df240cfc 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -3858,7 +3858,7 @@ static void gaudi_init_static_firmware_loader(struct hl_device *hdev)
static_loader->boot_err1_reg = mmCPU_BOOT_ERR1;
static_loader->preboot_version_offset_reg = mmPREBOOT_VER_OFFSET;
static_loader->boot_fit_version_offset_reg = mmUBOOT_VER_OFFSET;
- static_loader->sram_offset_mask = ~((u32)SRAM_BASE_ADDR);
+ static_loader->sram_offset_mask = ~(lower_32_bits(SRAM_BASE_ADDR));
}
static void gaudi_init_firmware_loader(struct hl_device *hdev)
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 06f5f1439e69..755e08cf2ecc 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -2484,7 +2484,7 @@ static void goya_init_static_firmware_loader(struct hl_device *hdev)
static_loader->boot_err1_reg = mmCPU_BOOT_ERR1;
static_loader->preboot_version_offset_reg = mmPREBOOT_VER_OFFSET;
static_loader->boot_fit_version_offset_reg = mmUBOOT_VER_OFFSET;
- static_loader->sram_offset_mask = ~((u32)SRAM_BASE_ADDR);
+ static_loader->sram_offset_mask = ~(lower_32_bits(SRAM_BASE_ADDR));
}
static void goya_init_firmware_loader(struct hl_device *hdev)