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]
This commit is contained in:
parent
666fec7ff2
commit
caaa7e9d7b
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue