pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/32602 )

Change subject: octphy: Fix clearly wrong noop assignment
......................................................................

octphy: Fix clearly wrong noop assignment

This code has been there since first octphy support was added.
New gcc 13.1.1 is catching this and reporting compilation errors:
"""
/osmo-bts/src/osmo-bts-octphy/l1_oml.c: In function ‘ts_connect_as’:
/osmo-bts/src/osmo-bts-octphy/l1_oml.c:1518:60: error: ‘oc’ is used 
uninitialized [-Werror=uninitialized]
 1518 |         tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
      |                                                            ^~
/osmo-bts/src/osmo-bts-octphy/l1_oml.c:1518:60: note: ‘oc’ was declared here
 1518 |         tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
      |                                                            ^~
/osmo-bts/src/osmo-bts-octphy/l1_oml.c: In function ‘bts_model_ts_disconnect’:
/osmo-bts/src/osmo-bts-octphy/l1_oml.c:1803:62: error: ‘oc’ is used 
uninitialized [-Werror=uninitialized]
 1803 |         tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
      |                                                              ^~
/osmo-bts/src/osmo-bts-octphy/l1_oml.c:1803:62: note: ‘oc’ was declared here
 1803 |         tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
      |                                                              ^~
"""
Change-Id: I0da7d3a94e9eba15b8d3d3d995bba532170d9df7
---
M src/osmo-bts-octphy/l1_oml.c
1 file changed, 29 insertions(+), 4 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 28fb60c..bb519a0 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1515,8 +1515,7 @@
        struct phy_instance *pinst = trx_phy_instance(ts->trx);
        struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl;
        struct msgb *msg = l1p_msgb_alloc();
-       tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
-           (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) oc;
+       tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc;

        oc = (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD*)
                msgb_put(msg, sizeof(*oc));
@@ -1800,8 +1799,7 @@
        struct phy_instance *pinst = trx_phy_instance(ts->trx);
        struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl;
        struct msgb *msg = l1p_msgb_alloc();
-       tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc =
-           (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *) oc;
+       tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc;

        oc = (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *)
            msgb_put(msg, sizeof(*oc));

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0da7d3a94e9eba15b8d3d3d995bba532170d9df7
Gerrit-Change-Number: 32602
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to