Change in osmo-bts[master]: common/rsl.c: fix size argument in memcmp() call

Vadim Yanitskiy gerrit-no-reply at
Tue Apr 23 09:36:23 UTC 2019

Vadim Yanitskiy has submitted this change and it was merged. ( )

Change subject: common/rsl.c: fix size argument in memcmp() call

common/rsl.c: fix size argument in memcmp() call

Found using clang-8:

  rsl.c:1607:93: warning: size argument in 'memcmp' call
                          is a comparison [-Wmemsize-comparison]
  rsl.c:1607:7: note: did you mean to compare the result of 'memcmp' instead?

It looks more logical to compare the result of memcmp() against
zero instead of passing 'sizeof(sysinfo_buf_t) != 0' as size.

Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
M src/common/rsl.c
1 file changed, 1 insertion(+), 1 deletion(-)

  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5287201..8f5d689 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1604,7 +1604,7 @@
 		uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO);
 		lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len);
-		if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t) != 0))
+		if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t)) != 0)
 			lchan->si.overridden |= (1 << osmo_si);
 			lchan->si.overridden &= ~(1 << osmo_si);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
Gerrit-Change-Number: 13740
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list