Revert "ata: pata_macio: Use WARN instead of BUG"

This reverts commit f78466050f.
This commit is contained in:
Ksawlii 2024-11-24 00:23:38 +01:00
parent 223197c81f
commit 6aaccefee5

View file

@ -540,8 +540,7 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)
while (sg_len) {
/* table overflow should never happen */
if (WARN_ON_ONCE(pi >= MAX_DCMDS))
return AC_ERR_SYSTEM;
BUG_ON (pi++ >= MAX_DCMDS);
len = (sg_len < MAX_DBDMA_SEG) ? sg_len : MAX_DBDMA_SEG;
table->command = cpu_to_le16(write ? OUTPUT_MORE: INPUT_MORE);
@ -553,13 +552,11 @@ static enum ata_completion_errors pata_macio_qc_prep(struct ata_queued_cmd *qc)
addr += len;
sg_len -= len;
++table;
++pi;
}
}
/* Should never happen according to Tejun */
if (WARN_ON_ONCE(!pi))
return AC_ERR_SYSTEM;
BUG_ON(!pi);
/* Convert the last command to an input/output */
table--;