Skip to content

Commit e1b8570

Browse files
author
Kyle Kearney
committed
Remove unnecessary reference-typed arguments
No callers make use of the modified argument values, so change them to a more straightforward pass by value.
1 parent 3ef04db commit e1b8570

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

features/storage/kvstore/conf/kv_config.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ FileSystem *_get_filesystem_default(const char *mount)
276276
#endif
277277
}
278278

279-
BlockDevice *_get_blockdevice_FLASHIAP(bd_addr_t &start_address, bd_size_t &size)
279+
BlockDevice *_get_blockdevice_FLASHIAP(bd_addr_t start_address, bd_size_t size)
280280
{
281281
#if COMPONENT_FLASHIAP
282282
int ret = TDBStore::get_flash_bounds_from_config(&start_address, &size);
@@ -292,7 +292,7 @@ BlockDevice *_get_blockdevice_FLASHIAP(bd_addr_t &start_address, bd_size_t &size
292292
#endif
293293
}
294294

295-
BlockDevice *_get_blockdevice_SPIF(bd_addr_t &start_address, bd_size_t &size)
295+
BlockDevice *_get_blockdevice_SPIF(bd_addr_t start_address, bd_size_t size)
296296
{
297297
#if COMPONENT_SPIF
298298

@@ -333,7 +333,7 @@ BlockDevice *_get_blockdevice_SPIF(bd_addr_t &start_address, bd_size_t &size)
333333
#endif
334334
}
335335

336-
BlockDevice *_get_blockdevice_QSPIF(bd_addr_t &start_address, bd_size_t &size)
336+
BlockDevice *_get_blockdevice_QSPIF(bd_addr_t start_address, bd_size_t size)
337337
{
338338
#if COMPONENT_QSPIF
339339

@@ -377,7 +377,7 @@ BlockDevice *_get_blockdevice_QSPIF(bd_addr_t &start_address, bd_size_t &size)
377377
#endif
378378
}
379379

380-
BlockDevice *_get_blockdevice_DATAFLASH(bd_addr_t &start_address, bd_size_t &size)
380+
BlockDevice *_get_blockdevice_DATAFLASH(bd_addr_t start_address, bd_size_t size)
381381
{
382382
#if COMPONENT_DATAFLASH
383383

@@ -418,7 +418,7 @@ BlockDevice *_get_blockdevice_DATAFLASH(bd_addr_t &start_address, bd_size_t &siz
418418
#endif
419419
}
420420

421-
BlockDevice *_get_blockdevice_SD(bd_addr_t &start_address, bd_size_t &size)
421+
BlockDevice *_get_blockdevice_SD(bd_addr_t start_address, bd_size_t size)
422422
{
423423
#if COMPONENT_SD
424424

@@ -487,7 +487,7 @@ BlockDevice *_get_blockdevice_SD(bd_addr_t &start_address, bd_size_t &size)
487487
#endif
488488
}
489489

490-
BlockDevice *_get_blockdevice_default(bd_addr_t &start_address, bd_size_t &size)
490+
BlockDevice *_get_blockdevice_default(bd_addr_t start_address, bd_size_t size)
491491
{
492492
#if COMPONENT_QSPIF
493493
return _get_blockdevice_QSPIF(start_address, size);
@@ -505,7 +505,7 @@ BlockDevice *_get_blockdevice_default(bd_addr_t &start_address, bd_size_t &size)
505505

506506
/* Same logic as _get_blockdevice_SD() except block device replaced with from
507507
* get_other_blockdevice() */
508-
BlockDevice *_get_blockdevice_other(bd_addr_t &start_address, bd_size_t &size)
508+
BlockDevice *_get_blockdevice_other(bd_addr_t start_address, bd_size_t size)
509509
{
510510
bd_addr_t aligned_end_address;
511511
bd_addr_t aligned_start_address;
@@ -565,21 +565,21 @@ MBED_WEAK BlockDevice *get_other_blockdevice()
565565
return NULL;
566566
}
567567

568-
int _create_internal_tdb(BlockDevice **internal_bd, KVStore **internal_tdb, bd_size_t *size, bd_addr_t *start_address)
568+
int _create_internal_tdb(BlockDevice **internal_bd, KVStore **internal_tdb, bd_size_t size, bd_addr_t start_address)
569569
{
570570
int ret;
571571

572572
//Get the default address and size for the TDBStore
573-
if (*size == 0 && *start_address == 0) {
573+
if (size == 0 && start_address == 0) {
574574
//Calculate the block device size and start address in case default values are used.
575-
ret = TDBStore::get_default_flash_addresses(start_address, size);
575+
ret = TDBStore::get_default_flash_addresses(&start_address, &size);
576576
if (ret != MBED_SUCCESS) {
577577
return MBED_ERROR_FAILED_OPERATION;
578578
}
579579
}
580580

581581
//Create internal FLASHIAP block device
582-
*internal_bd = GET_BLOCKDEVICE(INTERNAL_BLOCKDEVICE_NAME, *start_address, *size);
582+
*internal_bd = GET_BLOCKDEVICE(INTERNAL_BLOCKDEVICE_NAME, start_address, size);
583583
if (*internal_bd == NULL) {
584584
tr_error("KV Config: Fail to get internal BlockDevice.");
585585
return MBED_ERROR_FAILED_OPERATION ;
@@ -624,7 +624,7 @@ int _storage_config_TDB_INTERNAL()
624624
bd_size_t internal_size = MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE;
625625
bd_addr_t internal_start_address = MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS;
626626

627-
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, &internal_size, &internal_start_address);
627+
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, internal_size, internal_start_address);
628628
if (MBED_SUCCESS != ret) {
629629
tr_error("KV Config: Fail to create internal TDBStore");
630630
return ret;
@@ -669,7 +669,7 @@ int _storage_config_TDB_EXTERNAL()
669669
bd_size_t internal_rbp_size = MBED_CONF_STORAGE_TDB_EXTERNAL_RBP_INTERNAL_SIZE;
670670
bd_addr_t internal_start_address = MBED_CONF_STORAGE_TDB_EXTERNAL_INTERNAL_BASE_ADDRESS;
671671

672-
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, &internal_rbp_size, &internal_start_address);
672+
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, internal_rbp_size, internal_start_address);
673673
if (MBED_SUCCESS != ret) {
674674
tr_error("KV Config: Fail to create internal TDBStore");
675675
return ret;
@@ -813,7 +813,7 @@ int _storage_config_FILESYSTEM()
813813
bd_size_t internal_rbp_size = MBED_CONF_STORAGE_FILESYSTEM_RBP_INTERNAL_SIZE;
814814
bd_addr_t internal_start_address = MBED_CONF_STORAGE_FILESYSTEM_INTERNAL_BASE_ADDRESS;
815815

816-
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, &internal_rbp_size, &internal_start_address);
816+
int ret = _create_internal_tdb(&kvstore_config.internal_bd, &kvstore_config.internal_store, internal_rbp_size, internal_start_address);
817817
if (MBED_SUCCESS != ret) {
818818
tr_error("KV Config: Fail to create internal TDBStore");
819819
return ret;

0 commit comments

Comments
 (0)