-
Notifications
You must be signed in to change notification settings - Fork 3k
Storage: Add required header file and namespace element instead add all #8002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: Add required header file and namespace element instead add all #8002
Conversation
@ARMmbed/mbed-os-storage - Please review |
Needs a rebase to resolve a conflict. We should be good for Ci afterwards. |
1b0455f
to
adc255f
Compare
Rebased to resolve conflicts |
@ARMmbed/mbed-os-storage - Please review |
#include "mbed.h" | ||
|
||
#include "platform/mbed_assert.h" | ||
#include "ChainingBlockDevice.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does ChainingBlockDevice.h include itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.. 👍
@@ -36,7 +35,7 @@ ObservingBlockDevice::~ObservingBlockDevice() | |||
// Does nothing | |||
} | |||
|
|||
void ObservingBlockDevice::attach(Callback<void(BlockDevice *)> cb) | |||
void ObservingBlockDevice::attach(mbed::Callback<void(BlockDevice *)> cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not adding using namespace mbed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency, also after this cleanup next PR is to add all block devices and filesystem into the mbed namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can live with it. Specifically, if next PR is to bring those block devices into mbed namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have that PR already in place, but cannot merge unless this cleanup is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in general it looks good besides 2 minor issues.
@@ -510,7 +510,7 @@ static void nvstore_multi_thread_test() | |||
if (!threads[i]) { | |||
goto mem_fail; | |||
} | |||
threads[i]->start(callback(thread_test_worker)); | |||
threads[i]->start(mbed::callback(thread_test_worker)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again why not just adding using namespace mbed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to be consistent with the code in file https://github.com/ARMmbed/mbed-os/pull/8002/files/adc255fbec2e56c9058811a590f301d4d255aeaf#diff-3c5c355089a195140705371a70b7b5d0L464
Namespace is not used for std / rtos..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend to bring nvstore files also into mbed namespace in the next PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block device and file system was for sure.. NVstore will have to check with the storage and other teams
adc255f
to
8642ece
Compare
/moprh build |
Whoops. /morph build |
Build : SUCCESSBuild number : 3324 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2959 |
Test : SUCCESSBuild number : 3134 |
Description
Source inside mbed-os should not be using "mbed.h" even in CPP files, instead required header file and namespace should be explicitly added inside mbed-os
With #7760 PR, we will give an option to remove namespace.
Pull request type