msc/sccp_ran.h: fix: do not pass -1 to osmo_rat_type_name()

The problem is that osmo_rat_type_name() calls get_value_string(),
so we first cast -1 to 'const enum osmo_rat_type' and then to
'uint32_t'. Let's rather use OSMO_RAT_UNKNOWN.

Found by GCC with -Wextra in CFLAGS:

  warning: operand of ?: changes signedness from ‘int’ to
	   ‘const enum osmo_rat_type’ due to unsignedness
	   of other operand [-Wsign-compare]

Change-Id: I63ba355102d3cc035ba90121e06aba7cf1776aa0
changes/13/17013/2
Vadim Yanitskiy 3 years ago committed by fixeria
parent 601af0ca00
commit 064a1e0c54
  1. 4
      include/osmocom/msc/sccp_ran.h

@ -189,14 +189,14 @@ struct sccp_ran_inst;
#define LOG_SCCP_RAN_CO(sri, peer_addr, conn_id, level, fmt, args...) \
LOGP((sri) && (sri)->ran? (sri)->ran->log_subsys : DMSC, level, "(%s-%u%s%s) " fmt, \
osmo_rat_type_name((sri) && (sri)->ran? (sri)->ran->type : -1), conn_id, \
osmo_rat_type_name((sri) && (sri)->ran ? (sri)->ran->type : OSMO_RAT_UNKNOWN), conn_id, \
peer_addr ? " from " : "", \
peer_addr ? osmo_sccp_inst_addr_name((sri)->sccp, peer_addr) : "", \
## args)
#define LOG_SCCP_RAN_CL_CAT(sri, peer_addr, subsys, level, fmt, args...) \
LOGP(subsys, level, "(%s%s%s) " fmt, \
osmo_rat_type_name((sri) && (sri)->ran? (sri)->ran->type : -1), \
osmo_rat_type_name((sri) && (sri)->ran ? (sri)->ran->type : OSMO_RAT_UNKNOWN), \
peer_addr ? " from " : "", \
peer_addr ? osmo_sccp_inst_addr_name((sri)->sccp, peer_addr) : "", \
## args)

Loading…
Cancel
Save