From ea6cd4e7fdaff0b28b169fbd011ed9eb549303e1 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 29 Apr 2019 14:05:04 -0500 Subject: [PATCH] huawei: Remove unneeded if statement --- drivers/huaweimodem/gprs-context.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/huaweimodem/gprs-context.c b/drivers/huaweimodem/gprs-context.c index cae401c8..7e72ad92 100644 --- a/drivers/huaweimodem/gprs-context.c +++ b/drivers/huaweimodem/gprs-context.c @@ -256,7 +256,6 @@ static void huawei_gprs_activate_primary(struct ofono_gprs_context *gc, struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc); struct cb_data *cbd = cb_data_new(cb, data); char buf[64]; - int len; /* IPv6 support not implemented */ if (ctx->proto != OFONO_GPRS_PROTO_IP) @@ -265,14 +264,10 @@ static void huawei_gprs_activate_primary(struct ofono_gprs_context *gc, DBG("cid %u", ctx->cid); gcd->active_context = ctx->cid; - cbd->user = gc; - len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid); - - if (ctx->apn) - snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", - ctx->apn); + snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\",\"%s\"", + ctx->cid, ctx->apn); if (g_at_chat_send(gcd->chat, buf, none_prefix, at_cgdcont_cb, cbd, g_free) > 0)