[PATCH] base-call: remove unnecessary string duplications

Ben Chan benchan at chromium.org
Sat Apr 8 01:16:12 UTC 2017


---
 src/mm-base-call.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mm-base-call.c b/src/mm-base-call.c
index 6ce85d0d..606d24f2 100644
--- a/src/mm-base-call.c
+++ b/src/mm-base-call.c
@@ -754,7 +754,6 @@ call_accept (MMBaseCall *self,
              gpointer user_data)
 {
     CallAcceptContext *ctx;
-    gchar *cmd;
 
     /* Setup the context */
     ctx = g_new0 (CallAcceptContext, 1);
@@ -765,14 +764,12 @@ call_accept (MMBaseCall *self,
     ctx->self = g_object_ref (self);
     ctx->modem = g_object_ref (self->priv->modem);
 
-    cmd = g_strdup_printf ("ATA");
     mm_base_modem_at_command (ctx->modem,
-                              cmd,
+                              "ATA",
                               2,
                               FALSE,
                               (GAsyncReadyCallback)call_accept_ready,
                               ctx);
-    g_free (cmd);
 }
 
 /*****************************************************************************/
@@ -843,7 +840,6 @@ call_hangup (MMBaseCall *self,
              gpointer user_data)
 {
     CallHangupContext *ctx;
-    gchar *cmd;
 
     /* Setup the context */
     ctx = g_new0 (CallHangupContext, 1);
@@ -854,14 +850,12 @@ call_hangup (MMBaseCall *self,
     ctx->self = g_object_ref (self);
     ctx->modem = g_object_ref (self->priv->modem);
 
-    cmd = g_strdup_printf ("+CHUP");
     mm_base_modem_at_command (ctx->modem,
-                              cmd,
+                              "+CHUP",
                               2,
                               FALSE,
                               (GAsyncReadyCallback)call_hangup_ready,
                               ctx);
-    g_free (cmd);
 }
 
 /*****************************************************************************/
-- 
2.12.2.715.g7642488e1d-goog



More information about the ModemManager-devel mailing list