Re: [RFC 3/3] ata: sata_mv, avoid trigerrable BUG_ON

From: Jiri Slaby
Date: Fri Jun 14 2019 - 04:37:51 EST


On 14. 06. 19, 10:24, Sergei Shtylyov wrote:
>> --- a/drivers/ata/sata_mv.c
>> +++ b/drivers/ata/sata_mv.c
>> @@ -2098,12 +2098,10 @@ static int mv_qc_prep(struct ata_queued_cmd *qc)
>> ÂÂÂÂÂÂÂÂÂÂ * non-NCQ mode are: [RW] STREAM DMA and W DMA FUA EXT, none
>>  * of which are defined/used by Linux. If we get here, this
>> ÂÂÂÂÂÂÂÂÂÂ * driver needs work.
>> -ÂÂÂÂÂÂÂÂ *
>> -ÂÂÂÂÂÂÂÂ * FIXME: modify libata to give qc_prep a return value and
>> -ÂÂÂÂÂÂÂÂ * return error here.
>> ÂÂÂÂÂÂÂÂÂÂ */
>> -ÂÂÂÂÂÂÂ BUG_ON(tf->command);
>> -ÂÂÂÂÂÂÂ break;
>> +ÂÂÂÂÂÂÂ ata_port_err(ap, "%s: unsupported command: %d\n", __func__,
>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ tf->command);
>
> ÂÂ I'd use "%x" here instead of "%d".

Hi, that makes sense. Fixed locally to %.2x as the commands are defined
as such. Waiting for more comments before [v2] :).

thanks,
--
js
suse labs