Skip to content

Commit ecd9ecc

Browse files
floatiousdamien-lemoal
authored andcommitted
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>
1 parent f544644 commit ecd9ecc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/ata/libata-sata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ int ata_eh_get_ncq_success_sense(struct ata_link *link)
15451545
* If the command does not have any sense data, clear ATA_SENSE.
15461546
* Keep ATA_QCFLAG_EH_SUCCESS_CMD so that command is finished.
15471547
*/
1548-
if (!(sense_valid & (1 << tag))) {
1548+
if (!(sense_valid & BIT(tag))) {
15491549
qc->result_tf.status &= ~ATA_SENSE;
15501550
continue;
15511551
}
@@ -1634,7 +1634,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
16341634
return;
16351635
}
16361636

1637-
if (!(link->sactive & (1 << tag))) {
1637+
if (!(link->sactive & BIT(tag))) {
16381638
ata_link_err(link, "log page 10h reported inactive tag %d\n",
16391639
tag);
16401640
return;

0 commit comments

Comments
 (0)