From 39f89ceeb209cecc2f7ae8f8aa1f8c41c972ff92 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 13 Apr 2020 15:31:28 +0300 Subject: [PATCH] Fix UBsan warnings in ahci --- drivers/ata/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 12a1763..ba46fe9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -22,7 +22,7 @@ #define AHCI_CMD_LIST_SIZE 32 #define AHCI_CMD_TABLE_ENTSZ 256 -#define AHCI_PORT_IS_TFES (1 << 30) +#define AHCI_PORT_IS_TFES (1U << 30) #define AHCI_PORT_SSTS_IPM_ACTIVE 0x01 #define AHCI_PORT_SSTS_DET_CONNECTED 0x03 @@ -333,7 +333,7 @@ static int ahci_port_atapi_read(struct ahci_port *port, uint64_t lba, void *buf, if (i == prd_count - 1) { // Mark last PRDT entry - table_entry->prdt[i].dbc |= 1 << 31; + table_entry->prdt[i].dbc |= 1U << 31; } bytes_left -= prd_size;