Skip to content

Commit 07ebd92

Browse files
authored
Merge pull request #11494 from hugueskamba/hk-fix-coverity-iotcore-1334
Fix Coverity issue: Initialize FlashIAP non-static member in constructor
2 parents e1cfb7b + 8ea9aca commit 07ebd92

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

drivers/FlashIAP.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ namespace mbed {
6363
*/
6464
class FlashIAP : private NonCopyable<FlashIAP> {
6565
public:
66-
FlashIAP();
67-
~FlashIAP();
66+
constexpr FlashIAP() : _flash(), _page_buf(nullptr)
67+
{
68+
69+
}
6870

6971
/** Initialize a flash IAP device
7072
*

drivers/source/FlashIAP.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ static inline bool is_aligned(uint32_t number, uint32_t alignment)
4646
}
4747
}
4848

49-
FlashIAP::FlashIAP() : _page_buf(nullptr)
50-
{
51-
52-
}
53-
54-
FlashIAP::~FlashIAP()
55-
{
56-
57-
}
58-
5949
int FlashIAP::init()
6050
{
6151
int ret = 0;

platform/NonCopyable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ class NonCopyable {
172172
/**
173173
* Disallow construction of NonCopyable objects from outside of its hierarchy.
174174
*/
175-
NonCopyable() { }
175+
NonCopyable() = default;
176176
/**
177177
* Disallow destruction of NonCopyable objects from outside of its hierarchy.
178178
*/
179-
~NonCopyable() { }
179+
~NonCopyable() = default;
180180

181181
#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0))
182182
/**

0 commit comments

Comments
 (0)