Skip to content

Commit

Permalink
libata: use ata_tag_internal() consistently
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Tejun Heo committed May 11, 2018
1 parent e3ed893 commit 2e2cc67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
tf->flags |= tf_flags;

if (ata_ncq_enabled(dev) && likely(tag != ATA_TAG_INTERNAL)) {
if (ata_ncq_enabled(dev) && !ata_tag_internal(tag)) {
/* yay, NCQ */
if (!lba_48_ok(block, n_block))
return -ERANGE;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5120,7 +5120,7 @@ int ata_sas_allocate_tag(struct ata_port *ap)
tag = tag < max_queue ? tag : 0;

/* the last tag is reserved for internal command. */
if (tag == ATA_TAG_INTERNAL)
if (ata_tag_internal(tag))
continue;

if (!test_and_set_bit(tag, &ap->sas_tag_allocated)) {
Expand Down
2 changes: 1 addition & 1 deletion include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
return (tag < ATA_MAX_QUEUE) ? 1 : 0;
}

static inline unsigned int ata_tag_internal(unsigned int tag)
static inline bool ata_tag_internal(unsigned int tag)
{
return tag == ATA_TAG_INTERNAL;
}
Expand Down

0 comments on commit 2e2cc67

Please sign in to comment.