Skip to content

Commit dedf53a

Browse files
committed
[cppcheck] Add inline suppressions
Signed-off-by: Mykhailo Lohvynenko <Mykhailo_Lohvynenko@epam.com>
1 parent 4f6ef7a commit dedf53a

12 files changed

+35
-2
lines changed

src/communication/communication.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ void Communication::ClockUnsynced()
135135
mCondVar.NotifyOne();
136136
}
137137

138+
// cppcheck-suppress unusedFunction
138139
aos::Error Communication::Subscribes(aos::ConnectionSubscriberItf& subscriber)
139140
{
140141
aos::LockGuard lock(mMutex);
@@ -147,6 +148,7 @@ aos::Error Communication::Subscribes(aos::ConnectionSubscriberItf& subscriber)
147148
return aos::ErrorEnum::eNone;
148149
}
149150

151+
// cppcheck-suppress unusedFunction
150152
void Communication::Unsubscribes(aos::ConnectionSubscriberItf& subscriber)
151153
{
152154
aos::LockGuard lock(mMutex);

src/communication/tlschannel.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ aos::Error TLSChannel::SetupSSLConfig(const aos::String& certType)
185185
extern unsigned char __aos_root_ca_start[];
186186
extern unsigned char __aos_root_ca_end[];
187187

188+
// cppcheck-suppress comparePointers
188189
auto ret = mbedtls_x509_crt_parse(&mCACert, __aos_root_ca_start, __aos_root_ca_end - __aos_root_ca_start);
189190
if (ret != 0) {
190191
return AOS_ERROR_WRAP(ret);

src/domains/domd/domd_cfg_h3ulcb.c

+1
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ static int load_ipl_image(uint8_t* buf, size_t bufsize, uint64_t image_load_offs
473473
static ssize_t get_ipl_image_size(void* image_info, uint64_t* size)
474474
{
475475
ARG_UNUSED(image_info);
476+
// cppcheck-suppress comparePointers
476477
*size = __img_ipl_end - __img_ipl_start;
477478
return 0;
478479
}

src/domains/domd/domd_cfg_salvator_xs.c

+1
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ static int load_ipl_image(uint8_t* buf, size_t bufsize, uint64_t image_load_offs
495495
static ssize_t get_ipl_image_size(void* image_info, uint64_t* size)
496496
{
497497
ARG_UNUSED(image_info);
498+
// cppcheck-suppress comparePointers
498499
*size = __img_ipl_end - __img_ipl_start;
499500
return 0;
500501
}

src/domains/domd/domd_cfg_spider.c

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ static int load_ipl_image(uint8_t* buf, size_t bufsize, uint64_t image_load_offs
276276
static ssize_t get_ipl_image_size(void* image_info, uint64_t* size)
277277
{
278278
ARG_UNUSED(image_info);
279+
// cppcheck-suppress comparePointers
279280
*size = __img_ipl_end - __img_ipl_start;
280281
return 0;
281282
}

src/domains/domu/domu_cfg.c

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static int load_domu_image(uint8_t* buf, size_t bufsize, uint64_t image_load_off
3030
static ssize_t get_domu_image_size(void* image_info, uint64_t* size)
3131
{
3232
ARG_UNUSED(image_info);
33+
// cppcheck-suppress comparePointers
3334
*size = __img_domu_end - __img_domu_start;
3435
return 0;
3536
}

src/downloader/downloader.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ aos::Error Downloader::Init(DownloadRequesterItf& downloadRequester)
3434
return aos::ErrorEnum::eNone;
3535
}
3636

37+
// cppcheck-suppress unusedFunction
3738
aos::Error Downloader::Download(const aos::String& url, const aos::String& path, aos::DownloadContent contentType)
3839
{
3940
aos::UniqueLock lock(mMutex);

src/main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include "app/app.hpp"
1515
#include "logger/logger.hpp"
16+
17+
// cppcheck-suppress missingInclude
1618
#include "version.hpp"
1719

1820
#if !defined(CONFIG_NATIVE_APPLICATION)

src/monitoring/resourceusageprovider.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ aos::Error ResourceUsageProvider::GetNodeInfo(aos::monitoring::NodeInfo& nodeInf
6868
return aos::ErrorEnum::eNone;
6969
}
7070

71+
// cppcheck-suppress unusedFunction
7172
aos::Error ResourceUsageProvider::GetNodeMonitoringData(
7273
const aos::String& nodeID, aos::monitoring::MonitoringData& monitoringData)
7374
{
@@ -93,8 +94,8 @@ aos::Error ResourceUsageProvider::GetNodeMonitoringData(
9394
monitoringData.mCPU = ((cpuTimeDiff_ns / 10.0) / us_elapsed);
9495
}
9596

96-
LOG_DBG() << "Get node monitoring data: "
97-
<< "RAM(K): " << (monitoringData.mRAM / 1024) << ", CPU: " << monitoringData.mCPU;
97+
LOG_DBG() << "Get node monitoring data: RAM(K): " << (monitoringData.mRAM / 1024)
98+
<< ", CPU: " << monitoringData.mCPU;
9899

99100
mPrevNodeCPUTime = domain.cpu_ns;
100101
mPrevTime = curTime;
@@ -116,6 +117,7 @@ aos::Error ResourceUsageProvider::GetNodeMonitoringData(
116117
return aos::ErrorEnum::eNone;
117118
}
118119

120+
// cppcheck-suppress unusedFunction
119121
aos::Error ResourceUsageProvider::GetInstanceMonitoringData(
120122
const aos::String& instanceID, aos::monitoring::MonitoringData& monitoringData)
121123
{

src/ocispec/ocispec.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ static const struct json_obj_descr RuntimeSpecDescr[] = {
8989
* Public
9090
**********************************************************************************************************************/
9191

92+
// cppcheck-suppress unusedFunction
9293
aos::Error OCISpec::LoadImageManifest(const aos::String& path, aos::oci::ImageManifest& manifest)
9394
{
9495
aos::LockGuard lock(mMutex);
@@ -182,6 +183,7 @@ aos::Error OCISpec::LoadImageManifest(const aos::String& path, aos::oci::ImageMa
182183
return aos::ErrorEnum::eNone;
183184
}
184185

186+
// cppcheck-suppress unusedFunction
185187
aos::Error OCISpec::SaveImageManifest(const aos::String& path, const aos::oci::ImageManifest& manifest)
186188
{
187189
aos::LockGuard lock(mMutex);
@@ -261,6 +263,7 @@ aos::Error OCISpec::SaveImageManifest(const aos::String& path, const aos::oci::I
261263
return aos::ErrorEnum::eNone;
262264
}
263265

266+
// cppcheck-suppress unusedFunction
264267
aos::Error OCISpec::LoadImageSpec(const aos::String& path, aos::oci::ImageSpec& imageSpec)
265268
{
266269
aos::LockGuard lock(mMutex);
@@ -305,6 +308,7 @@ aos::Error OCISpec::LoadImageSpec(const aos::String& path, aos::oci::ImageSpec&
305308
return aos::ErrorEnum::eNone;
306309
}
307310

311+
// cppcheck-suppress unusedFunction
308312
aos::Error OCISpec::SaveImageSpec(const aos::String& path, const aos::oci::ImageSpec& imageSpec)
309313
{
310314
aos::LockGuard lock(mMutex);
@@ -360,6 +364,7 @@ aos::Error OCISpec::SaveImageSpec(const aos::String& path, const aos::oci::Image
360364
return aos::ErrorEnum::eNone;
361365
}
362366

367+
// cppcheck-suppress unusedFunction
363368
aos::Error OCISpec::LoadRuntimeSpec(const aos::String& path, aos::oci::RuntimeSpec& runtimeSpec)
364369
{
365370
aos::LockGuard lock(mMutex);
@@ -470,6 +475,7 @@ aos::Error OCISpec::LoadRuntimeSpec(const aos::String& path, aos::oci::RuntimeSp
470475
return aos::ErrorEnum::eNone;
471476
}
472477

478+
// cppcheck-suppress unusedFunction
473479
aos::Error OCISpec::SaveRuntimeSpec(const aos::String& path, const aos::oci::RuntimeSpec& runtimeSpec)
474480
{
475481
aos::LockGuard lock(mMutex);

src/runner/runner.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ aos::Error Runner::Init(RunStatusReceiverItf& statusReceiver)
2525
return aos::ErrorEnum::eNone;
2626
}
2727

28+
// cppcheck-suppress unusedFunction
2829
RunStatus Runner::StartInstance(const aos::String& instanceID, const aos::String& runtimeDir)
2930
{
3031
RunStatus runStatus {instanceID, aos::InstanceRunStateEnum::eActive, aos::ErrorEnum::eNone};
@@ -38,6 +39,7 @@ RunStatus Runner::StartInstance(const aos::String& instanceID, const aos::String
3839
return runStatus;
3940
}
4041

42+
// cppcheck-suppress unusedFunction
4143
aos::Error Runner::StopInstance(const aos::String& instanceID)
4244
{
4345
auto ret = xrun_kill(instanceID.CStr());

src/storage/storage.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ aos::Error Storage::Init()
4444
return aos::ErrorEnum::eNone;
4545
}
4646

47+
// cppcheck-suppress unusedFunction
4748
aos::Error Storage::AddInstance(const aos::InstanceInfo& instance)
4849
{
4950
aos::LockGuard lock(mMutex);
@@ -58,6 +59,7 @@ aos::Error Storage::AddInstance(const aos::InstanceInfo& instance)
5859
});
5960
}
6061

62+
// cppcheck-suppress unusedFunction
6163
aos::Error Storage::UpdateInstance(const aos::InstanceInfo& instance)
6264
{
6365
aos::LockGuard lock(mMutex);
@@ -75,6 +77,7 @@ aos::Error Storage::UpdateInstance(const aos::InstanceInfo& instance)
7577
return aos::ErrorEnum::eNone;
7678
}
7779

80+
// cppcheck-suppress unusedFunction
7881
aos::Error Storage::RemoveInstance(const aos::InstanceIdent& instanceIdent)
7982
{
8083
aos::LockGuard lock(mMutex);
@@ -90,6 +93,7 @@ aos::Error Storage::RemoveInstance(const aos::InstanceIdent& instanceIdent)
9093
return aos::ErrorEnum::eNone;
9194
}
9295

96+
// cppcheck-suppress unusedFunction
9397
aos::Error Storage::GetAllInstances(aos::Array<aos::InstanceInfo>& instances)
9498
{
9599
aos::LockGuard lock(mMutex);
@@ -110,6 +114,7 @@ aos::Error Storage::GetAllInstances(aos::Array<aos::InstanceInfo>& instances)
110114
return err;
111115
}
112116

117+
// cppcheck-suppress unusedFunction
113118
aos::Error Storage::AddService(const aos::sm::servicemanager::ServiceData& service)
114119
{
115120
aos::LockGuard lock(mMutex);
@@ -124,6 +129,7 @@ aos::Error Storage::AddService(const aos::sm::servicemanager::ServiceData& servi
124129
});
125130
}
126131

132+
// cppcheck-suppress unusedFunction
127133
aos::Error Storage::UpdateService(const aos::sm::servicemanager::ServiceData& service)
128134
{
129135
aos::LockGuard lock(mMutex);
@@ -147,6 +153,7 @@ aos::Error Storage::RemoveService(const aos::String& serviceID, uint64_t aosVers
147153
});
148154
}
149155

156+
// cppcheck-suppress unusedFunction
150157
aos::Error Storage::GetAllServices(aos::Array<aos::sm::servicemanager::ServiceData>& services)
151158
{
152159
aos::LockGuard lock(mMutex);
@@ -167,6 +174,7 @@ aos::Error Storage::GetAllServices(aos::Array<aos::sm::servicemanager::ServiceDa
167174
return err;
168175
}
169176

177+
// cppcheck-suppress unusedFunction
170178
aos::RetWithError<aos::sm::servicemanager::ServiceData> Storage::GetService(const aos::String& serviceID)
171179
{
172180
aos::LockGuard lock(mMutex);
@@ -187,6 +195,7 @@ aos::RetWithError<aos::sm::servicemanager::ServiceData> Storage::GetService(cons
187195
return aos::RetWithError<aos::sm::servicemanager::ServiceData>(*retServiceData);
188196
}
189197

198+
// cppcheck-suppress unusedFunction
190199
aos::Error Storage::AddCertInfo(const aos::String& certType, const aos::iam::certhandler::CertInfo& certInfo)
191200
{
192201
aos::LockGuard lock(mMutex);
@@ -205,6 +214,7 @@ aos::Error Storage::AddCertInfo(const aos::String& certType, const aos::iam::cer
205214
});
206215
}
207216

217+
// cppcheck-suppress unusedFunction
208218
aos::Error Storage::RemoveCertInfo(const aos::String& certType, const aos::String& certURL)
209219
{
210220
aos::LockGuard lock(mMutex);
@@ -215,6 +225,7 @@ aos::Error Storage::RemoveCertInfo(const aos::String& certType, const aos::Strin
215225
[&certType, &certURL](const CertInfo& data) { return data.mCertType == certType && data.mCertURL == certURL; });
216226
}
217227

228+
// cppcheck-suppress unusedFunction
218229
aos::Error Storage::RemoveAllCertsInfo(const aos::String& certType)
219230
{
220231
aos::LockGuard lock(mMutex);
@@ -229,6 +240,7 @@ aos::Error Storage::RemoveAllCertsInfo(const aos::String& certType)
229240
return aos::ErrorEnum::eNone;
230241
}
231242

243+
// cppcheck-suppress unusedFunction
232244
aos::Error Storage::GetCertsInfo(const aos::String& certType, aos::Array<aos::iam::certhandler::CertInfo>& certsInfo)
233245
{
234246
aos::LockGuard lock(mMutex);
@@ -251,6 +263,7 @@ aos::Error Storage::GetCertsInfo(const aos::String& certType, aos::Array<aos::ia
251263
return err;
252264
}
253265

266+
// cppcheck-suppress unusedFunction
254267
aos::Error Storage::GetCertInfo(
255268
const aos::Array<uint8_t>& issuer, const aos::Array<uint8_t>& serial, aos::iam::certhandler::CertInfo& cert)
256269
{

0 commit comments

Comments
 (0)