Skip to content
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

[Ignore] Fix warnings in block devices #2

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ bd_size_t SPIFBlockDevice::get_erase_size(bd_addr_t addr)
bd_size_t SPIFBlockDevice::size() const
{
if (!_is_initialized) {
return SPIF_BD_ERROR_DEVICE_ERROR;
return 0;
}

return _device_size_bytes;
Expand Down
6 changes: 3 additions & 3 deletions features/storage/blockdevice/BufferedBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ bd_size_t BufferedBlockDevice::get_program_size() const
bd_size_t BufferedBlockDevice::get_erase_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size();
Expand All @@ -260,7 +260,7 @@ bd_size_t BufferedBlockDevice::get_erase_size() const
bd_size_t BufferedBlockDevice::get_erase_size(bd_addr_t addr) const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size(addr);
Expand All @@ -278,7 +278,7 @@ int BufferedBlockDevice::get_erase_value() const
bd_size_t BufferedBlockDevice::size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->size();
Expand Down
2 changes: 1 addition & 1 deletion features/storage/blockdevice/ChainingBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ bd_size_t ChainingBlockDevice::get_erase_size() const
bd_size_t ChainingBlockDevice::get_erase_size(bd_addr_t addr) const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

bd_addr_t bd_start_addr = 0;
Expand Down
10 changes: 5 additions & 5 deletions features/storage/blockdevice/ExhaustibleBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int ExhaustibleBlockDevice::erase(bd_addr_t addr, bd_size_t size)
bd_size_t ExhaustibleBlockDevice::get_read_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_read_size();
Expand All @@ -151,7 +151,7 @@ bd_size_t ExhaustibleBlockDevice::get_read_size() const
bd_size_t ExhaustibleBlockDevice::get_program_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_program_size();
Expand All @@ -160,7 +160,7 @@ bd_size_t ExhaustibleBlockDevice::get_program_size() const
bd_size_t ExhaustibleBlockDevice::get_erase_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size();
Expand All @@ -169,7 +169,7 @@ bd_size_t ExhaustibleBlockDevice::get_erase_size() const
bd_size_t ExhaustibleBlockDevice::get_erase_size(bd_addr_t addr) const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size(addr);
Expand All @@ -187,7 +187,7 @@ int ExhaustibleBlockDevice::get_erase_value() const
bd_size_t ExhaustibleBlockDevice::size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->size();
Expand Down
10 changes: 5 additions & 5 deletions features/storage/blockdevice/FlashSimBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int FlashSimBlockDevice::sync()
bd_size_t FlashSimBlockDevice::get_read_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_read_size();
Expand All @@ -105,7 +105,7 @@ bd_size_t FlashSimBlockDevice::get_read_size() const
bd_size_t FlashSimBlockDevice::get_program_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_program_size();
Expand All @@ -114,7 +114,7 @@ bd_size_t FlashSimBlockDevice::get_program_size() const
bd_size_t FlashSimBlockDevice::get_erase_size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size();
Expand All @@ -123,7 +123,7 @@ bd_size_t FlashSimBlockDevice::get_erase_size() const
bd_size_t FlashSimBlockDevice::get_erase_size(bd_addr_t addr) const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->get_erase_size(addr);
Expand All @@ -132,7 +132,7 @@ bd_size_t FlashSimBlockDevice::get_erase_size(bd_addr_t addr) const
bd_size_t FlashSimBlockDevice::size() const
{
if (!_is_initialized) {
return BD_ERROR_DEVICE_ERROR;
return 0;
}

return _bd->size();
Expand Down