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

Aleksander Morgado aleksander at aleksander.es
Thu Dec 14 09:23:23 UTC 2017


On Wed, Dec 13, 2017 at 6:54 PM, Eric Caruso <ejcaruso at chromium.org> wrote:
> 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?

Not a big deal really. Didn't realize about the surrounding code not
doing that, and I wonder why I didn't do it myself :)

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list