summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2025-04-16 12:31:31 +0300
committerDamien Le Moal <dlemoal@kernel.org>2025-04-21 02:59:07 +0300
commitecd9ecc75d150b82a832eb7aaa9b7b983fea5271 (patch)
tree09fae4266785a1b55b37f414d7e478af3c8418b6
parentf54464458d34141911047258090f25c67204cda4 (diff)
downloadlinux-ecd9ecc75d150b82a832eb7aaa9b7b983fea5271.tar.xz
ata: libata-sata: Use BIT() macro to convert tag to bit field
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> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Igor Pylypiv <ipylypiv@google.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
-rw-r--r--drivers/ata/libata-sata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index 89d3b784706b..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 & (1 << 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;