lte: fix static code analysys warnings (thanks to Natale Patriciello)

This commit is contained in:
Biljana Bojovic
2017-03-07 14:33:39 +01:00
parent efbfce88c7
commit 1cd0010e10
5 changed files with 17 additions and 14 deletions

View File

@@ -488,12 +488,6 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
{
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters dlcqiInfoReq;
dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
int cqiNum = m_dlCqiReceived.size ();
if (cqiNum > MAX_CQI_LIST)
{
cqiNum = MAX_CQI_LIST;
}
dlcqiInfoReq.m_cqiList.insert (dlcqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
m_dlCqiReceived.erase (m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
m_schedSapProvider->SchedDlCqiInfoReq (dlcqiInfoReq);

View File

@@ -190,7 +190,16 @@ UeManager::DoInitialize ()
LteEnbCmacSapProvider::LcInfo lcinfo;
lcinfo.rnti = m_rnti;
lcinfo.lcId = lcid;
// leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured
// Initialise the rest of lcinfo structure even if CCCH (LCID 0) is pre-configured, and only m_rnti and lcid will be used from passed lcinfo structure.
// See FF LTE MAC Scheduler Iinterface Specification v1.11, 4.3.4 logicalChannelConfigListElement
lcinfo.lcGroup = 0;
lcinfo.qci = 0;
lcinfo.isGbr = false;
lcinfo.mbrUl = 0;
lcinfo.mbrDl = 0;
lcinfo.gbrUl = 0;
lcinfo.gbrDl = 0;
// MacSapUserForRlc in the ComponentCarrierManager MacSapUser
LteMacSapUser* lteMacSapUser = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ());
// Signal Channel are only on Primary Carrier
@@ -767,6 +776,7 @@ UeManager::SendUeContextRelease ()
ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId;
ueCtxReleaseParams.newEnbUeX2apId = m_rnti;
ueCtxReleaseParams.sourceCellId = m_sourceCellId;
ueCtxReleaseParams.targetCellId = m_targetCellId;
m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams);
SwitchToState (CONNECTED_NORMALLY);
m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti);
@@ -2040,6 +2050,7 @@ LteEnbRrc::ConfigureCell (uint16_t cellId)
// Enabling MIB transmission
LteRrcSap::MasterInformationBlock mib;
mib.dlBandwidth = m_dlBandwidth;
mib.systemFrameNumber = 0;
// Enabling SIB1 transmission with default values
m_sib1.cellAccessRelatedInfo.cellIdentity = cellId;
m_sib1.cellAccessRelatedInfo.csgIndication = false;

View File

@@ -579,7 +579,6 @@ LteMiErrorModel::GetTbDecodificationStats (const SpectrumValue& sinr, const std:
uint16_t Z = 6144; // max size of a codeblock (including CRC)
uint32_t B = size * 8;
// B = 1234;
uint32_t L = 0;
uint32_t C = 0; // no. of codeblocks
uint32_t Cplus = 0; // no. of codeblocks with size K+
uint32_t Kplus = 0; // no. of codeblocks with size K+
@@ -590,13 +589,13 @@ LteMiErrorModel::GetTbDecodificationStats (const SpectrumValue& sinr, const std:
if (B <= Z)
{
// only one codeblock
L = 0;
//L = 0;
C = 1;
B1 = B;
}
else
{
L = 24;
uint32_t L = 24;
C = ceil ((double)B / ((double)(Z-L)));
B1 = B + C * L;
}

View File

@@ -286,7 +286,6 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
NS_ASSERT (m_vtA < m_vtS);
SequenceNumber10 sn;
sn.SetModulusBase (m_vtA);
bool found = false;
for (sn = m_vtA; sn < m_vtS; sn++)
{
uint16_t seqNumberValue = sn.GetValue ();
@@ -300,7 +299,6 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
if (( packet->GetSize () <= bytes )
|| m_txOpportunityForRetxAlwaysBigEnough)
{
found = true;
// According to 5.2.1, the data field is left as is, but we rebuild the header
LteRlcAmHeader rlcAmHeader;
packet->RemoveHeader (rlcAmHeader);
@@ -389,7 +387,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId,
}
}
}
NS_ASSERT_MSG (found, "m_retxBufferSize > 0, but no PDU considered for retx found");
NS_ASSERT_MSG (false, "m_retxBufferSize > 0, but no PDU considered for retx found");
}
else if ( m_txonBufferSize > 0 )
{

View File

@@ -267,7 +267,6 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint32_t earfcn, uint8_t t
double powerTxW = std::pow (10., (powerTx - 30) / 10);
double basicPowerTxW = std::pow (10., (powerTx - 30) / 10);
double txPowerDensity = (powerTxW / (txBandwidthConfiguration * 180000));
for (std::vector <int>::iterator it = activeRbs.begin (); it != activeRbs.end (); it++)
{
@@ -275,6 +274,8 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint32_t earfcn, uint8_t t
std::map<int, double>::iterator powerIt = powerTxMap.find (rbId);
double txPowerDensity;
if (powerIt != powerTxMap.end ())
{
powerTxW = std::pow (10., (powerIt->second - 30) / 10);