# \[PATCH\] ahci: use BUILD\_BUG\_ON for constants comparison

- From: Heiner Kallweit \<hkallweit1@gmail.com\>
- Date: 2021-02-16 11:13:22 
- List: linux-ide
- Page: https://ratatoskr.run/linux-ide/2021/02/16727657
- Thread: https://ratatoskr.run/linux-ide/2021/02/16727657/t.md

```text
Both are constant enum values, therefore we can check at
compile time.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/ata/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 00ba8e5a1..e953425e1 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1673,7 +1673,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	VPRINTK("ENTER\n");
 
-	WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
+	BUILD_BUG_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
 
 	ata_print_version_once(&pdev->dev, DRV_VERSION);
 
-- 
2.30.1

```
