Re: [PATCH 10/21] uas: zap_pending: data urbs should have completed at this time

Hans de Goede
2014-09-10T14:17:38Z

Hi,

On 09/10/2014 04:10 PM, Oliver Neukum wrote:
> On Wed, 2014-09-10 at 13:46 +0200, Hans de Goede wrote:
>> uas_log_cmd_state(cmnd, __func__);
>> - /* all urbs are killed, clear inflight bits */
>> - cmdinfo->state &= ~(COMMAND_INFLIGHT |
>> - DATA_IN_URB_INFLIGHT |
>> - DATA_OUT_URB_INFLIGHT);
>> + /* Sense urbs were killed, clear COMMAND_INFLIGHT
>> manually */
>> + cmdinfo->state &= ~COMMAND_INFLIGHT;
>> cmnd->result = result << 16;
>> - uas_try_complete(cmnd, __func__);
>> + WARN_ON(uas_try_complete(cmnd, __func__) != 0);
>
> That looks like very bad style. WARN_ON() shouldn't
> have side effects.

A valid point, I'll respin this patch to store the result and check it
separately.

Regards,

Hans