summaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-07-14 09:05:42 +0900
committerTejun Heo <tj@kernel.org>2016-07-14 10:44:51 -0400
commitb1c04e80c6da5f5d3d4778ede23c59666135fdeb (patch)
treefcd51c4ed47d0c428da9c0dcb7e27341fc2fafd3 /include/linux/libata.h
parent2983860c766870b701c4a34f435c1e18db086244 (diff)
downloadlinux-b1c04e80c6da5f5d3d4778ede23c59666135fdeb.tar.gz
linux-b1c04e80c6da5f5d3d4778ede23c59666135fdeb.tar.bz2
linux-b1c04e80c6da5f5d3d4778ede23c59666135fdeb.zip
libata: return boolean values from ata_is_*
This way we don't have to worry about the exact bit postition of the test to leak out and any crazy propagation effects in the callers. Suggested-by: Tejun Heo <tj@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d15c19e331d1..4e5a09c6dc10 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1063,32 +1063,32 @@ static inline unsigned int ata_prot_flags(u8 prot)
return 0;
}
-static inline int ata_is_atapi(u8 prot)
+static inline bool ata_is_atapi(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
}
-static inline int ata_is_nodata(u8 prot)
+static inline bool ata_is_nodata(u8 prot)
{
return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
}
-static inline int ata_is_pio(u8 prot)
+static inline bool ata_is_pio(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
}
-static inline int ata_is_dma(u8 prot)
+static inline bool ata_is_dma(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
}
-static inline int ata_is_ncq(u8 prot)
+static inline bool ata_is_ncq(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
}
-static inline int ata_is_data(u8 prot)
+static inline bool ata_is_data(u8 prot)
{
return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
}
@@ -1407,7 +1407,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap)
return ap->nr_pmp_links != 0;
}
-static inline int ata_is_host_link(const struct ata_link *link)
+static inline bool ata_is_host_link(const struct ata_link *link)
{
return link == &link->ap->link || link == link->ap->slave_link;
}
@@ -1422,7 +1422,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap)
return false;
}
-static inline int ata_is_host_link(const struct ata_link *link)
+static inline bool ata_is_host_link(const struct ata_link *link)
{
return 1;
}