summaryrefslogtreecommitdiffstats
path: root/src/call-forwarding.c
diff options
context:
space:
mode:
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>2012-04-10 15:17:26 +0300
committerDenis Kenzior <denkenz@gmail.com>2012-04-23 15:33:44 -0500
commitd797a868c058e03c016f4eb517ead0f47abbf44c (patch)
tree9ab22f7713455c5da8c7be80422120de8838df4e /src/call-forwarding.c
parente67a7fb913ae396a71696f913040ee0cae89d3e8 (diff)
downloadofono-d797a868c058e03c016f4eb517ead0f47abbf44c.tar.bz2
call-forwarding: Streamline cf_find_timeout() logic
Diffstat (limited to 'src/call-forwarding.c')
-rw-r--r--src/call-forwarding.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 0733f76f..2a7bff05 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -108,16 +108,11 @@ static struct ofono_call_forwarding_condition *cf_cond_find(GSList *l, int cls)
return NULL;
}
-static int cf_find_timeout(GSList *cf_list, int cls)
+static int cf_cond_find_timeout(GSList *l, int cls)
{
- struct ofono_call_forwarding_condition *c;
-
- c = cf_cond_find(cf_list, cls);
-
- if (c == NULL)
- return DEFAULT_NO_REPLY_TIMEOUT;
+ struct ofono_call_forwarding_condition *cond = cf_cond_find(l, cls);
- return c->time;
+ return cond ? cond->time : DEFAULT_NO_REPLY_TIMEOUT;
}
static void cf_cond_list_print(GSList *l)
@@ -820,7 +815,7 @@ static DBusMessage *cf_set_property(DBusConnection *conn, DBusMessage *msg,
if (number[0] != '\0')
string_to_phone_number(number, &ph);
- timeout = cf_find_timeout(cf->cf_conditions[type], cls);
+ timeout = cf_cond_find_timeout(cf->cf_conditions[type], cls);
return set_property_request(cf, msg, type, cls, &ph,
timeout);