Skip to content

Commit 2e2cc67

Browse files
axboehtejun
authored andcommitted
libata: use ata_tag_internal() consistently
Some check for the value directly, use the provided helper instead. Also make it return a bool, since that's what it does. Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent e3ed893 commit 2e2cc67

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
759759
tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
760760
tf->flags |= tf_flags;
761761

762-
if (ata_ncq_enabled(dev) && likely(tag != ATA_TAG_INTERNAL)) {
762+
if (ata_ncq_enabled(dev) && !ata_tag_internal(tag)) {
763763
/* yay, NCQ */
764764
if (!lba_48_ok(block, n_block))
765765
return -ERANGE;

drivers/ata/libata-scsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5120,7 +5120,7 @@ int ata_sas_allocate_tag(struct ata_port *ap)
51205120
tag = tag < max_queue ? tag : 0;
51215121

51225122
/* the last tag is reserved for internal command. */
5123-
if (tag == ATA_TAG_INTERNAL)
5123+
if (ata_tag_internal(tag))
51245124
continue;
51255125

51265126
if (!test_and_set_bit(tag, &ap->sas_tag_allocated)) {

include/linux/libata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
14911491
return (tag < ATA_MAX_QUEUE) ? 1 : 0;
14921492
}
14931493

1494-
static inline unsigned int ata_tag_internal(unsigned int tag)
1494+
static inline bool ata_tag_internal(unsigned int tag)
14951495
{
14961496
return tag == ATA_TAG_INTERNAL;
14971497
}

0 commit comments

Comments
 (0)