mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
ata: libata: rename ata_dev_is_zac()
The helper function ata_dev_is_zac() checks if a device is a ZAC class device (host managed zoned disk) or if it is a host aware zoned disk, that is, a regular ATA disk that supports the zoned capabilities. So the name of this helper function is confusing as it hints at the first case only. Rename this helper function to ata_dev_is_zoned() to avoid confusions and better reflect the two cases tested. Use this helper in ata_scsiop_inq_std(), ata_scsiop_read_cap() and ata_scsi_report_supported_opcodes() instead of having the same tests open coded. While at it, to stay consistent with this renaming, also rename ata_dev_config_zac() to ata_dev_config_zoned(). Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org>
This commit is contained in:
@@ -2488,7 +2488,7 @@ static void ata_dev_config_sense_reporting(struct ata_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void ata_dev_config_zac(struct ata_device *dev)
|
||||
static void ata_dev_config_zoned(struct ata_device *dev)
|
||||
{
|
||||
unsigned int err_mask;
|
||||
u8 *identify_buf = dev->sector_buf;
|
||||
@@ -2497,7 +2497,7 @@ static void ata_dev_config_zac(struct ata_device *dev)
|
||||
dev->zac_zones_optimal_nonseq = U32_MAX;
|
||||
dev->zac_zones_max_open = U32_MAX;
|
||||
|
||||
if (!ata_dev_is_zac(dev))
|
||||
if (!ata_dev_is_zoned(dev))
|
||||
return;
|
||||
|
||||
if (!ata_identify_page_supported(dev, ATA_LOG_ZONED_INFORMATION)) {
|
||||
@@ -3111,7 +3111,7 @@ int ata_dev_configure(struct ata_device *dev)
|
||||
ata_dev_config_fua(dev);
|
||||
ata_dev_config_devslp(dev);
|
||||
ata_dev_config_sense_reporting(dev);
|
||||
ata_dev_config_zac(dev);
|
||||
ata_dev_config_zoned(dev);
|
||||
ata_dev_config_trusted(dev);
|
||||
ata_dev_config_cpr(dev);
|
||||
ata_dev_config_cdl(dev);
|
||||
|
||||
@@ -2023,7 +2023,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_device *dev,
|
||||
if (rbuf[32] == 0 || rbuf[32] == ' ')
|
||||
memcpy(&rbuf[32], "n/a ", 4);
|
||||
|
||||
if (ata_id_zoned_cap(dev->id) || dev->class == ATA_DEV_ZAC)
|
||||
if (ata_dev_is_zoned(dev))
|
||||
memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc));
|
||||
else
|
||||
memcpy(rbuf + 58, versions, sizeof(versions));
|
||||
@@ -2063,7 +2063,7 @@ static unsigned int ata_scsiop_inq_00(struct ata_device *dev,
|
||||
};
|
||||
|
||||
for (i = 0; i < sizeof(pages); i++) {
|
||||
if (pages[i] == 0xb6 && !ata_dev_is_zac(dev))
|
||||
if (pages[i] == 0xb6 && !ata_dev_is_zoned(dev))
|
||||
continue;
|
||||
rbuf[num_pages + 4] = pages[i];
|
||||
num_pages++;
|
||||
@@ -2320,7 +2320,7 @@ static unsigned int ata_scsiop_inq_b2(struct ata_device *dev,
|
||||
static unsigned int ata_scsiop_inq_b6(struct ata_device *dev,
|
||||
struct scsi_cmnd *cmd, u8 *rbuf)
|
||||
{
|
||||
if (!ata_dev_is_zac(dev)) {
|
||||
if (!ata_dev_is_zoned(dev)) {
|
||||
ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
|
||||
return 0;
|
||||
}
|
||||
@@ -2851,7 +2851,7 @@ static unsigned int ata_scsiop_read_cap(struct ata_device *dev,
|
||||
rbuf[10] = sector_size >> (8 * 1);
|
||||
rbuf[11] = sector_size;
|
||||
|
||||
if (ata_id_zoned_cap(dev->id) || dev->class == ATA_DEV_ZAC)
|
||||
if (ata_dev_is_zoned(dev))
|
||||
rbuf[12] = (1 << 4); /* RC_BASIS */
|
||||
rbuf[13] = log2_per_phys;
|
||||
rbuf[14] = (lowest_aligned >> 8) & 0x3f;
|
||||
@@ -3659,8 +3659,7 @@ static unsigned int ata_scsi_report_supported_opcodes(struct ata_device *dev,
|
||||
break;
|
||||
case ZBC_IN:
|
||||
case ZBC_OUT:
|
||||
if (ata_id_zoned_cap(dev->id) ||
|
||||
dev->class == ATA_DEV_ZAC)
|
||||
if (ata_dev_is_zoned(dev))
|
||||
supported = 3;
|
||||
break;
|
||||
case SECURITY_PROTOCOL_IN:
|
||||
|
||||
@@ -44,7 +44,7 @@ static inline bool ata_sstatus_online(u32 sstatus)
|
||||
return (sstatus & 0xf) == 0x3;
|
||||
}
|
||||
|
||||
static inline bool ata_dev_is_zac(struct ata_device *dev)
|
||||
static inline bool ata_dev_is_zoned(struct ata_device *dev)
|
||||
{
|
||||
/* Host managed device or host aware device */
|
||||
return dev->class == ATA_DEV_ZAC ||
|
||||
|
||||
Reference in New Issue
Block a user