From dd065e3be1a31b20aeac37ef052eec36296a0b58 Mon Sep 17 00:00:00 2001 From: Yossi Levy Date: Wed, 26 Sep 2018 14:35:48 +0300 Subject: [PATCH] Fix warnings in block devices --- .../blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp | 2 +- features/storage/blockdevice/BufferedBlockDevice.cpp | 6 +++--- features/storage/blockdevice/ChainingBlockDevice.cpp | 2 +- .../storage/blockdevice/ExhaustibleBlockDevice.cpp | 10 +++++----- features/storage/blockdevice/FlashSimBlockDevice.cpp | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp index 4b65a5a249..08e9a28ef7 100644 --- a/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp @@ -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; diff --git a/features/storage/blockdevice/BufferedBlockDevice.cpp b/features/storage/blockdevice/BufferedBlockDevice.cpp index 86c324b26d..251826a847 100644 --- a/features/storage/blockdevice/BufferedBlockDevice.cpp +++ b/features/storage/blockdevice/BufferedBlockDevice.cpp @@ -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(); @@ -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); @@ -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(); diff --git a/features/storage/blockdevice/ChainingBlockDevice.cpp b/features/storage/blockdevice/ChainingBlockDevice.cpp index 60a87a8e11..c98ef60c6b 100644 --- a/features/storage/blockdevice/ChainingBlockDevice.cpp +++ b/features/storage/blockdevice/ChainingBlockDevice.cpp @@ -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; diff --git a/features/storage/blockdevice/ExhaustibleBlockDevice.cpp b/features/storage/blockdevice/ExhaustibleBlockDevice.cpp index 36d5d94736..c16a906461 100644 --- a/features/storage/blockdevice/ExhaustibleBlockDevice.cpp +++ b/features/storage/blockdevice/ExhaustibleBlockDevice.cpp @@ -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(); @@ -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(); @@ -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(); @@ -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); @@ -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(); diff --git a/features/storage/blockdevice/FlashSimBlockDevice.cpp b/features/storage/blockdevice/FlashSimBlockDevice.cpp index f69e4aa389..c011d1ba02 100644 --- a/features/storage/blockdevice/FlashSimBlockDevice.cpp +++ b/features/storage/blockdevice/FlashSimBlockDevice.cpp @@ -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(); @@ -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(); @@ -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(); @@ -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); @@ -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();