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

Oliver Neukum
2014-09-10T14:10:27Z

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.

Regards
Oliver