Skip to content

Commit dd065e3

Browse files
Yossi LevyYossi Levy
authored andcommitted
Fix warnings in block devices
1 parent a0a9b54 commit dd065e3

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ bd_size_t SPIFBlockDevice::get_erase_size(bd_addr_t addr)
461461
bd_size_t SPIFBlockDevice::size() const
462462
{
463463
if (!_is_initialized) {
464-
return SPIF_BD_ERROR_DEVICE_ERROR;
464+
return 0;
465465
}
466466

467467
return _device_size_bytes;

features/storage/blockdevice/BufferedBlockDevice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ bd_size_t BufferedBlockDevice::get_program_size() const
251251
bd_size_t BufferedBlockDevice::get_erase_size() const
252252
{
253253
if (!_is_initialized) {
254-
return BD_ERROR_DEVICE_ERROR;
254+
return 0;
255255
}
256256

257257
return _bd->get_erase_size();
@@ -260,7 +260,7 @@ bd_size_t BufferedBlockDevice::get_erase_size() const
260260
bd_size_t BufferedBlockDevice::get_erase_size(bd_addr_t addr) const
261261
{
262262
if (!_is_initialized) {
263-
return BD_ERROR_DEVICE_ERROR;
263+
return 0;
264264
}
265265

266266
return _bd->get_erase_size(addr);
@@ -278,7 +278,7 @@ int BufferedBlockDevice::get_erase_value() const
278278
bd_size_t BufferedBlockDevice::size() const
279279
{
280280
if (!_is_initialized) {
281-
return BD_ERROR_DEVICE_ERROR;
281+
return 0;
282282
}
283283

284284
return _bd->size();

features/storage/blockdevice/ChainingBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ bd_size_t ChainingBlockDevice::get_erase_size() const
254254
bd_size_t ChainingBlockDevice::get_erase_size(bd_addr_t addr) const
255255
{
256256
if (!_is_initialized) {
257-
return BD_ERROR_DEVICE_ERROR;
257+
return 0;
258258
}
259259

260260
bd_addr_t bd_start_addr = 0;

features/storage/blockdevice/ExhaustibleBlockDevice.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int ExhaustibleBlockDevice::erase(bd_addr_t addr, bd_size_t size)
142142
bd_size_t ExhaustibleBlockDevice::get_read_size() const
143143
{
144144
if (!_is_initialized) {
145-
return BD_ERROR_DEVICE_ERROR;
145+
return 0;
146146
}
147147

148148
return _bd->get_read_size();
@@ -151,7 +151,7 @@ bd_size_t ExhaustibleBlockDevice::get_read_size() const
151151
bd_size_t ExhaustibleBlockDevice::get_program_size() const
152152
{
153153
if (!_is_initialized) {
154-
return BD_ERROR_DEVICE_ERROR;
154+
return 0;
155155
}
156156

157157
return _bd->get_program_size();
@@ -160,7 +160,7 @@ bd_size_t ExhaustibleBlockDevice::get_program_size() const
160160
bd_size_t ExhaustibleBlockDevice::get_erase_size() const
161161
{
162162
if (!_is_initialized) {
163-
return BD_ERROR_DEVICE_ERROR;
163+
return 0;
164164
}
165165

166166
return _bd->get_erase_size();
@@ -169,7 +169,7 @@ bd_size_t ExhaustibleBlockDevice::get_erase_size() const
169169
bd_size_t ExhaustibleBlockDevice::get_erase_size(bd_addr_t addr) const
170170
{
171171
if (!_is_initialized) {
172-
return BD_ERROR_DEVICE_ERROR;
172+
return 0;
173173
}
174174

175175
return _bd->get_erase_size(addr);
@@ -187,7 +187,7 @@ int ExhaustibleBlockDevice::get_erase_value() const
187187
bd_size_t ExhaustibleBlockDevice::size() const
188188
{
189189
if (!_is_initialized) {
190-
return BD_ERROR_DEVICE_ERROR;
190+
return 0;
191191
}
192192

193193
return _bd->size();

features/storage/blockdevice/FlashSimBlockDevice.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int FlashSimBlockDevice::sync()
9696
bd_size_t FlashSimBlockDevice::get_read_size() const
9797
{
9898
if (!_is_initialized) {
99-
return BD_ERROR_DEVICE_ERROR;
99+
return 0;
100100
}
101101

102102
return _bd->get_read_size();
@@ -105,7 +105,7 @@ bd_size_t FlashSimBlockDevice::get_read_size() const
105105
bd_size_t FlashSimBlockDevice::get_program_size() const
106106
{
107107
if (!_is_initialized) {
108-
return BD_ERROR_DEVICE_ERROR;
108+
return 0;
109109
}
110110

111111
return _bd->get_program_size();
@@ -114,7 +114,7 @@ bd_size_t FlashSimBlockDevice::get_program_size() const
114114
bd_size_t FlashSimBlockDevice::get_erase_size() const
115115
{
116116
if (!_is_initialized) {
117-
return BD_ERROR_DEVICE_ERROR;
117+
return 0;
118118
}
119119

120120
return _bd->get_erase_size();
@@ -123,7 +123,7 @@ bd_size_t FlashSimBlockDevice::get_erase_size() const
123123
bd_size_t FlashSimBlockDevice::get_erase_size(bd_addr_t addr) const
124124
{
125125
if (!_is_initialized) {
126-
return BD_ERROR_DEVICE_ERROR;
126+
return 0;
127127
}
128128

129129
return _bd->get_erase_size(addr);
@@ -132,7 +132,7 @@ bd_size_t FlashSimBlockDevice::get_erase_size(bd_addr_t addr) const
132132
bd_size_t FlashSimBlockDevice::size() const
133133
{
134134
if (!_is_initialized) {
135-
return BD_ERROR_DEVICE_ERROR;
135+
return 0;
136136
}
137137

138138
return _bd->size();

0 commit comments

Comments
 (0)