From 6e0ca6a32897156a3c0bbf3a4a28a0fe000ab8a2 Mon Sep 17 00:00:00 2001 From: Guisen Yang Date: Tue, 24 Sep 2019 17:51:56 +0800 Subject: [PATCH] qcacmn: Fix compilation failure when NAPI is disabled Encap napi APIs by macro, inline the no-op version APIs, and define the API when the feature is disabled but API is called by others. Change-Id: I9c0409b8abcb6260b1adfd5a656f8c1fa42695b5 CRs-Fixed: 2534594 --- hif/src/hif_exec.c | 10 ++++++---- hif/src/hif_napi.h | 6 +++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hif/src/hif_exec.c b/hif/src/hif_exec.c index 339359b1c473..4b0d2fcbd283 100644 --- a/hif/src/hif_exec.c +++ b/hif/src/hif_exec.c @@ -467,7 +467,8 @@ static void hif_latency_profile_measure(struct hif_exec_context *hif_ext_group) hif_ext_group->sched_latency_stats[7]++; } #else -static void hif_latency_profile_measure(struct hif_exec_context *hif_ext_group) +static inline +void hif_latency_profile_measure(struct hif_exec_context *hif_ext_group) { } #endif @@ -484,11 +485,13 @@ static void hif_latency_profile_start(struct hif_exec_context *hif_ext_group) hif_ext_group->tstamp = qdf_ktime_to_ms(qdf_ktime_get()); } #else -static void hif_latency_profile_start(struct hif_exec_context *hif_ext_group) +static inline +void hif_latency_profile_start(struct hif_exec_context *hif_ext_group) { } #endif +#ifdef FEATURE_NAPI /** * hif_exec_poll() - napi poll * napi: napi struct @@ -584,7 +587,6 @@ struct hif_execution_ops napi_sched_ops = { .kill = &hif_exec_napi_kill, }; -#ifdef FEATURE_NAPI /** * hif_exec_napi_create() - allocate and initialize a napi exec context * @scale: a binary shift factor to map NAPI budget from\to internal @@ -611,7 +613,7 @@ static struct hif_exec_context *hif_exec_napi_create(uint32_t scale) #else static struct hif_exec_context *hif_exec_napi_create(uint32_t scale) { - HIF_WARN("%s: FEATURE_NAPI not defined, making tasklet"); + HIF_WARN("%s: FEATURE_NAPI not defined, making tasklet", __func__); return hif_exec_tasklet_create(); } #endif diff --git a/hif/src/hif_napi.h b/hif/src/hif_napi.h index 0d164f155f7d..23084c001456 100644 --- a/hif/src/hif_napi.h +++ b/hif/src/hif_napi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -237,6 +237,10 @@ static inline struct qca_napi_data *hif_napi_get_all( struct hif_opaque_softc *hif) { return NULL; } +static inline struct qca_napi_info *hif_get_napi(int napi_id, + struct qca_napi_data *napid) +{ return NULL; } + static inline int hif_napi_event(struct hif_opaque_softc *hif, enum qca_napi_event event, void *data)