Skip to content

Commit

Permalink
ata: libata: drop ata_msg_warn()
Browse files Browse the repository at this point in the history
The WARN level was always enabled, so drop ata_msg_warn().

Signed-off-by: Hannes Reinecke <[email protected]>
Signed-off-by: Damien Le Moal <[email protected]>
  • Loading branch information
hreinecke authored and Damien Le Moal committed Jan 5, 2022
1 parent 2f784b9 commit 16d4246
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 8 additions & 11 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,9 +1571,8 @@ unsigned ata_exec_internal_sg(struct ata_device *dev,
else
ata_qc_complete(qc);

if (ata_msg_warn(ap))
ata_dev_warn(dev, "qc timeout (cmd 0x%x)\n",
command);
ata_dev_warn(dev, "qc timeout (cmd 0x%x)\n",
command);
}

spin_unlock_irqrestore(ap->lock, flags);
Expand Down Expand Up @@ -1932,9 +1931,8 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
return 0;

err_out:
if (ata_msg_warn(ap))
ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n",
reason, err_mask);
ata_dev_warn(dev, "failed to IDENTIFY (%s, err_mask=0x%x)\n",
reason, err_mask);
return rc;
}

Expand Down Expand Up @@ -2683,8 +2681,7 @@ int ata_dev_configure(struct ata_device *dev)

rc = atapi_cdb_len(id);
if ((rc < 12) || (rc > ATAPI_CDB_LEN)) {
if (ata_msg_warn(ap))
ata_dev_warn(dev, "unsupported CDB len\n");
ata_dev_warn(dev, "unsupported CDB len %d\n", rc);
rc = -EINVAL;
goto err_out_nosup;
}
Expand Down Expand Up @@ -5342,11 +5339,11 @@ struct ata_port *ata_port_alloc(struct ata_host *host)

#if defined(ATA_VERBOSE_DEBUG)
/* turn on all debugging levels */
ap->msg_enable = 0x000F;
ap->msg_enable = 0x0007;
#elif defined(ATA_DEBUG)
ap->msg_enable = ATA_MSG_DRV | ATA_MSG_INFO | ATA_MSG_WARN;
ap->msg_enable = ATA_MSG_DRV | ATA_MSG_INFO;
#else
ap->msg_enable = ATA_MSG_DRV | ATA_MSG_WARN;
ap->msg_enable = ATA_MSG_DRV;
#endif

mutex_init(&ap->scsi_scan_mutex);
Expand Down
2 changes: 0 additions & 2 deletions include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ enum {
ATA_MSG_DRV = 0x0001,
ATA_MSG_INFO = 0x0002,
ATA_MSG_PROBE = 0x0004,
ATA_MSG_WARN = 0x0008,
};

#define ata_msg_drv(p) ((p)->msg_enable & ATA_MSG_DRV)
#define ata_msg_info(p) ((p)->msg_enable & ATA_MSG_INFO)
#define ata_msg_probe(p) ((p)->msg_enable & ATA_MSG_PROBE)
#define ata_msg_warn(p) ((p)->msg_enable & ATA_MSG_WARN)

static inline u32 ata_msg_init(int dval, int default_msg_enable_bits)
{
Expand Down

0 comments on commit 16d4246

Please sign in to comment.