at_ps: Remove useless variable initializations and checks
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Fri, 11 Jan 2013 15:38:14 +0000 (16:38 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 06:50:32 +0000 (15:50 +0900)
Change-Id: I22301c7c620237ed55ec69337873f5f0134333b4

src/at_ps.c

index 88e2d74..bb362d1 100644 (file)
@@ -155,15 +155,14 @@ error:
        set_pdp_context(co_ps, ps_context, DEACTIVATE);
 
 out:
-       if (tokens != NULL)
-               tcore_at_tok_free(tokens);
+       tcore_at_tok_free(tokens);
 
        dbg("Exit");
 }
 
 static void get_pdp_address(CoreObject *co_ps, CoreObject *ps_context)
 {
-       char *cmd_str = NULL;
+       char *cmd_str;
        unsigned int cid = tcore_context_get_id(ps_context);
 
        dbg("Enter");
@@ -248,7 +247,7 @@ static void on_response_set_pdp_context_activate(TcorePending *p, int data_len,
 static TReturn set_pdp_context(CoreObject *co_ps, CoreObject *ps_context,
                                        enum pdp_context_state state)
 {
-       char *cmd_str = NULL;
+       char *cmd_str;
        unsigned int cid = tcore_context_get_id(ps_context);
        int ret = TCORE_RETURN_SUCCESS;
        TcorePendingResponseCallback cb = NULL;
@@ -387,7 +386,7 @@ static gboolean on_cgev_notification(CoreObject *co_ps, const void *data,
        GSList *tokens = NULL;
        GSList *lines = (GSList *)data;
        const char *line = lines->data;
-       char *noti_data = NULL;
+       char *noti_data;
        unsigned int cid;
 
        dbg("Enter");
@@ -417,8 +416,7 @@ static gboolean on_cgev_notification(CoreObject *co_ps, const void *data,
        notify_context_deactivated(co_ps, cid);
 
 out:
-       if (tokens != NULL)
-               tcore_at_tok_free(tokens);
+       tcore_at_tok_free(tokens);
 
        dbg("Exit");