Skip to content

Commit

Permalink
[PATCH] libata: implement ata_dev_absent()
Browse files Browse the repository at this point in the history
For the time being we cannot use ata_dev_present() as it was renamed
to ata_dev_enabled() but we still need presence test.  Implement
negation of the test.  Conveniently, the negated result is needed in
more places.  This is suggested by Jeff Garzik.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 2, 2006
1 parent 852ee16 commit 002c805
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ static inline unsigned int ata_class_disabled(unsigned int class)
return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP;
}

static inline unsigned int ata_class_absent(unsigned int class)
{
return !ata_class_enabled(class) && !ata_class_disabled(class);
}

static inline unsigned int ata_dev_enabled(const struct ata_device *dev)
{
return ata_class_enabled(dev->class);
Expand All @@ -692,6 +697,11 @@ static inline unsigned int ata_dev_disabled(const struct ata_device *dev)
return ata_class_disabled(dev->class);
}

static inline unsigned int ata_dev_absent(const struct ata_device *dev)
{
return ata_class_absent(dev->class);
}

static inline u8 ata_chk_status(struct ata_port *ap)
{
return ap->ops->check_status(ap);
Expand Down

0 comments on commit 002c805

Please sign in to comment.