[PATCH 3/3] Add: online and post_online methods to isimodem driver
Rémi Denis-Courmont
remi at remlab.net
Tue May 25 14:01:16 PDT 2010
Le mardi 25 mai 2010 23:51:09 Aki Niemi, vous avez écrit :
> > i.e. if ISI online status equals to MTC state normal, then no error,
> > otherwise, error. C does not provide a *logical* XOR operator that would
> > simplify this.
>
> It just isn't very readable.
>
> Write that open, and I am able to parse it, so I think something like
> this would be better:
>
> bool not_online = isi->online != TRUE;
> bool not_normal = mtc_state != MTC_NORMAL;
>
> struct ofono_error error = {
> not_normal && not_online ? NO_ERROR : FAILURE;
> };
Err no. You've put a logical AND where Pekka had a logical NOT XOR.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the ofono
mailing list