From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: linux-ide@vger.kernel.org, Igor Pylypiv <ipylypiv@google.com>,
Hannes Reinecke <hare@suse.de>, Niklas Cassel <cassel@kernel.org>
Subject: [PATCH v2 3/3] ata: libata-sata: Use BIT() macro
Date: Tue, 15 Apr 2025 09:30:17 +0200 [thread overview]
Message-ID: <20250415073013.414987-8-cassel@kernel.org> (raw)
In-Reply-To: <20250415073013.414987-5-cassel@kernel.org>
The BIT() macro is commonly used in the kernel.
Make use of it when converting a tag, fetched from the Successful NCQ
Commands log or the NCQ Command Error log, to a bit field.
This makes the code easier to read.
Suggested-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
drivers/ata/libata-sata.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index 076953d18db9..4e3034af285e 100644
--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -1545,7 +1545,7 @@ int ata_eh_get_ncq_success_sense(struct ata_link *link)
* If the command does not have any sense data, clear ATA_SENSE.
* Keep ATA_QCFLAG_EH_SUCCESS_CMD so that command is finished.
*/
- if (!(sense_valid & (1ULL << tag))) {
+ if (!(sense_valid & BIT(tag))) {
qc->result_tf.status &= ~ATA_SENSE;
continue;
}
@@ -1634,7 +1634,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
return;
}
- if (!(link->sactive & (1 << tag))) {
+ if (!(link->sactive & BIT(tag))) {
ata_link_err(link, "log page 10h reported inactive tag %d\n",
tag);
return;
--
2.49.0
next prev parent reply other threads:[~2025-04-15 7:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 7:30 [PATCH v2 0/3] Successful NCQ commands sense_valid cleanups/fixes Niklas Cassel
2025-04-15 7:30 ` [PATCH v2 1/3] ata: libata-sata: Save all fields from sense data descriptor Niklas Cassel
2025-04-16 8:35 ` Damien Le Moal
2025-04-15 7:30 ` [PATCH v2 2/3] ata: libata-sata: Simplify sense_valid fetching Niklas Cassel
2025-04-15 18:03 ` Igor Pylypiv
2025-04-15 7:30 ` Niklas Cassel [this message]
2025-04-15 7:47 ` [PATCH v2 3/3] ata: libata-sata: Use BIT() macro Hannes Reinecke
2025-04-15 18:05 ` Igor Pylypiv
2025-04-16 8:32 ` Damien Le Moal
2025-04-16 9:19 ` Niklas Cassel
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=20250415073013.414987-8-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=ipylypiv@google.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.