diff options
author | Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> | 2012-04-10 15:17:28 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-04-23 15:39:27 -0500 |
commit | 63566128229500830cb573fdbbd3c64dd4c5b447 (patch) | |
tree | 3da896dc0ed83a2fa2ffe7567b9d437558e27842 /src/call-forwarding.c | |
parent | 9d8aa928b8981caafa395bc219327156fb747580 (diff) | |
download | ofono-63566128229500830cb573fdbbd3c64dd4c5b447.tar.gz |
call-forwarding: Streamline set_query_cf_callback()
Diffstat (limited to 'src/call-forwarding.c')
-rw-r--r-- | src/call-forwarding.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/call-forwarding.c b/src/call-forwarding.c index 0bf406af..1b6c41b8 100644 --- a/src/call-forwarding.c +++ b/src/call-forwarding.c @@ -646,32 +646,29 @@ static void set_query_cf_callback(const struct ofono_error *error, int total, void *data) { struct ofono_call_forwarding *cf = data; - GSList *l; - DBusMessage *reply; if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { ofono_error("Setting succeeded, but query failed"); cf->flags &= ~CALL_FORWARDING_FLAG_CACHED; - reply = __ofono_error_failed(cf->pending); - __ofono_dbus_pending_reply(&cf->pending, reply); + __ofono_dbus_pending_reply(&cf->pending, + __ofono_error_failed(cf->pending)); return; } - if (cf->query_next == cf->query_end) { - reply = dbus_message_new_method_return(cf->pending); - __ofono_dbus_pending_reply(&cf->pending, reply); - } + if (cf->query_next == cf->query_end) + __ofono_dbus_pending_reply(&cf->pending, + dbus_message_new_method_return(cf->pending)); - l = cf_cond_list_create(total, list); - set_new_cond_list(cf, cf->query_next, l); + set_new_cond_list(cf, cf->query_next, cf_cond_list_create(total, list)); DBG("%s conditions:", cf_type_lut[cf->query_next]); - cf_cond_list_print(l); + cf_cond_list_print(cf->cf_conditions[cf->query_next]); - if (cf->query_next != cf->query_end) { - cf->query_next++; - set_query_next_cf_cond(cf); - } + if (cf->query_next == cf->query_end) + return; + + cf->query_next++; + set_query_next_cf_cond(cf); } static void set_query_next_cf_cond(struct ofono_call_forwarding *cf) |