From dca99b7428a6ae6f25544cc70a7057838fd609e6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 8 Sep 2022 10:19:09 -0500 Subject: gemaltomodem: Fix GCC warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CC drivers/gemaltomodem/gprs-context.o drivers/gemaltomodem/gprs-context.c: In function ‘gemalto_gprs_activate_primary’: drivers/gemaltomodem/gprs-context.c:195:13: error: the comparison will always evaluate as ‘true’ for the address of ‘apn’ will never be NULL [-Werror=address] 195 | if (ctx->apn) | ^~~ In file included from drivers/gemaltomodem/gprs-context.c:36: ./include/ofono/gprs-context.h:44:14: note: ‘apn’ declared here 44 | char apn[OFONO_GPRS_MAX_APN_LENGTH + 1]; | ^~~ --- drivers/gemaltomodem/gprs-context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gemaltomodem/gprs-context.c b/drivers/gemaltomodem/gprs-context.c index c0837bed..336748dc 100644 --- a/drivers/gemaltomodem/gprs-context.c +++ b/drivers/gemaltomodem/gprs-context.c @@ -192,8 +192,7 @@ static void gemalto_gprs_activate_primary(struct ofono_gprs_context *gc, break; } - if (ctx->apn) - snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", ctx->apn); + snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"", ctx->apn); if (g_at_chat_send(gcd->chat, buf, none_prefix, cgdcont_enable_cb, gc, NULL)) -- cgit v1.2.1