From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-ide@vger.kernel.org
Subject: [PATCH] ahci: use BUILD_BUG_ON for constants comparison
Date: Tue, 16 Feb 2021 12:12:23 +0100 [thread overview]
Message-ID: <64ed387c-fdef-279c-dace-7c26ffd3cdb6@gmail.com> (raw)
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
reply other threads:[~2021-02-16 11:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=64ed387c-fdef-279c-dace-7c26ffd3cdb6@gmail.com \
--to=hkallweit1@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).