Change in osmo-msc[master]: msc/sccp_ran.h: fix: do not pass -1 to osmo_rat_type_name()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon Jan 27 18:21:10 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/17013 )

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

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
---
M include/osmocom/msc/sccp_ran.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/sccp_ran.h b/include/osmocom/msc/sccp_ran.h
index f190d91..f84bf61 100644
--- a/include/osmocom/msc/sccp_ran.h
+++ b/include/osmocom/msc/sccp_ran.h
@@ -189,14 +189,14 @@
 
 #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)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/17013
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I63ba355102d3cc035ba90121e06aba7cf1776aa0
Gerrit-Change-Number: 17013
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Assignee: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200127/ad6dd0fc/attachment.htm>


More information about the gerrit-log mailing list