[PATCH v2] mm-iface-modem: add check_for_sim_swap method and enable steps

Eric Caruso ejcaruso at chromium.org
Wed Dec 13 17:54:22 UTC 2017


Thanks for catching these!

On Wed, Dec 13, 2017 at 1:20 AM, Aleksander Morgado
<aleksander at aleksander.es> wrote:
> > +    MM_IFACE_MODEM_GET_INTERFACE (self)->check_for_sim_swap_finish (self, res, &error);
> > +    if (error) {
>
> This is not a big deal, but for methods returning a gboolean, it is assumed that error is set if they return FALSE, so you can just do:
> if (!check_for_sim_swap_finish (self, res, &error)) {
>     // process error
> }
>

It looks like the surrounding code is not very consistent about this.
For example, setup_flow_control_finish is a method returning gboolean
but we check the error instead of the return value.

Is this worth cleaning up in a future patch?


More information about the ModemManager-devel mailing list