sysmo: Fix memcmp in RF-MUTE.req for superfemto < 3.6.0

Fixes following compilation warning:
In file included from l1_if.c:32:0:
l1_if.c: In function ‘l1if_mute_rf’:
/include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument]
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
                              ^
l1_if.c:1405:29: note: in expansion of macro ‘ARRAY_SIZE’
  if (!memcmp(mute, unmuted, ARRAY_SIZE(mute))) {
                             ^~~~~~~~~~
l1_if.c:1388:51: note: declared here
 int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
                                                   ^~~~
In file included from l1_if.c:32:0:
/include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument]
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
                              ^
l1_if.c:1408:19: note: in expansion of macro ‘ARRAY_SIZE’
   for (i = 0; i < ARRAY_SIZE(mute); ++i)
                   ^~~~~~~~~~
l1_if.c:1388:51: note: declared here
 int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
                                                   ^~~~

Change-Id: Id040aeb35549ddb75072942be0093064a89092a6
This commit is contained in:
Pau Espin 2018-06-22 11:13:54 +02:00
parent 5fd4aaaebb
commit ba3fa11ae2
1 changed files with 2 additions and 2 deletions

View File

@ -1402,10 +1402,10 @@ int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
LOGP(DL1C, LOGL_ERROR, "RF-MUTE.req not supported by SuperFemto\n");
msgb_free(msg);
/* always acknowledge an un-MUTE (which is a no-op if MUTE is not supported */
if (!memcmp(mute, unmuted, ARRAY_SIZE(mute))) {
if (!memcmp(mute, unmuted, ARRAY_SIZE(unmuted))) {
bts_update_status(BTS_STATUS_RF_MUTE, mute[0]);
oml_mo_rf_lock_chg(&trx->mo, mute, 1);
for (i = 0; i < ARRAY_SIZE(mute); ++i)
for (i = 0; i < ARRAY_SIZE(unmuted); ++i)
mute_handle_ts(&trx->ts[i], mute[i]);
return 0;
}