[PATCH] Telit plugin: add load_unlock_retries interface
Aleksander Morgado
aleksander at aleksander.es
Wed Dec 16 00:56:34 PST 2015
>
>> And I just realized after submitting that all errors are ignored
>> during all the steps... I think the logic I suggested still applies,
>> though, to keep clear who owns the 'retries' object.
>>
>> But now, shouldn't we fail with an error if e.g. none of the retries
>> checks succeeds?
>
> My idea here is to avoid skipping one or more checks of the retries only
> because the previous one failed, this is why I used only logging messages to
> signal the failures (and this is why I used mm_err, in place of mm_warn),
> but yes, if none of the checks succeeds, return with a failure would be the
> right thing to do.
>
Better mm_warn(); mm_err() is actually used only in 2 single places to
flag programmer errors, not logic errors.
> I would put a flag in the Context struct to take trace that at least one
> check succeeded and at the last step (PUK2) I would check this flag and
> decide whether return with failure or not. What do you think about that?
Given that you already have the LOAD_UNLOCK_RETRIES_STEP_LAST step,
you could do the final error check there. If none of the checks
succeeded, you could then g_simple_async_result_set_error() instead of
set_op_res_gpointer().
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list