aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_transp_hw.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-04-12 22:21:49 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-04-12 22:31:06 +0200
commitcaaa7e9d7b9fe3bb18ee83474c75fcdb46b8414f (patch)
treeccb8a9b33d80cc19079faf42e8627253b916913e /src/osmo-bts-sysmo/l1_transp_hw.c
parent666fec7ff23e125730d7e13aa6d68112cde082de (diff)
misc: Address a compiler warning and add an assert to a branch
The compiler can not know that the "int priv_nr" will hold the enum values of the write queue, add a default branch and add a warning and an assert there. l1_transp_hw.c:108:1: warning: control reaches end of non-void function [-Wreturn-type]
Diffstat (limited to 'src/osmo-bts-sysmo/l1_transp_hw.c')
-rw-r--r--src/osmo-bts-sysmo/l1_transp_hw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c
index f7bb42f0..1954dadd 100644
--- a/src/osmo-bts-sysmo/l1_transp_hw.c
+++ b/src/osmo-bts-sysmo/l1_transp_hw.c
@@ -19,6 +19,7 @@
*
*/
+#include <assert.h>
#include <stdint.h>
#include <unistd.h>
#include <errno.h>
@@ -103,6 +104,12 @@ static int l1if_fd_cb(struct osmo_fd *ofd, unsigned int what)
case MQ_TCH_WRITE:
case MQ_PDTCH_WRITE:
return l1if_handle_l1prim(fl1h, msg);
+ default:
+ /* The compiler can't know that priv_nr is an enum. Assist. */
+ LOGP(DL1C, LOGL_FATAL, "writing on a wrong queue: %d\n",
+ ofd->priv_nr);
+ assert(false);
+ break;
}
};