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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Tue Apr 23 08:15:00 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/13740


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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/13740/1

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);
 		else
 			lchan->si.overridden &= ~(1 << osmo_si);

-- 
To view, visit https://gerrit.osmocom.org/13740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
Gerrit-Change-Number: 13740
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190423/a30d3909/attachment.html>


More information about the gerrit-log mailing list