storage/stream_flash: Make context const where not modified

The commit sets const qualifier struct stream_flash_ctx *ctx parameter
of Stream Flash API calls:
  stream_flash_bytes_written
  stream_flash_progress_save
  stream_flash_progress_clear

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2024-10-04 20:35:32 +02:00 committed by David Leach
parent 23805301b0
commit 87ce37f7c4
2 changed files with 6 additions and 6 deletions

View File

@ -97,7 +97,7 @@ int stream_flash_init(struct stream_flash_ctx *ctx, const struct device *fdev,
*
* @return Number of payload bytes written to flash.
*/
size_t stream_flash_bytes_written(struct stream_flash_ctx *ctx);
size_t stream_flash_bytes_written(const struct stream_flash_ctx *ctx);
/**
* @brief Process input buffers to be written to flash device in single blocks.
@ -164,7 +164,7 @@ int stream_flash_progress_load(struct stream_flash_ctx *ctx,
*
* @return non-negative on success, negative errno code on fail
*/
int stream_flash_progress_save(struct stream_flash_ctx *ctx,
int stream_flash_progress_save(const struct stream_flash_ctx *ctx,
const char *settings_key);
/**
@ -176,7 +176,7 @@ int stream_flash_progress_save(struct stream_flash_ctx *ctx,
*
* @return non-negative on success, negative errno code on fail
*/
int stream_flash_progress_clear(struct stream_flash_ctx *ctx,
int stream_flash_progress_clear(const struct stream_flash_ctx *ctx,
const char *settings_key);
#ifdef __cplusplus

View File

@ -237,7 +237,7 @@ int stream_flash_buffered_write(struct stream_flash_ctx *ctx, const uint8_t *dat
return rc;
}
size_t stream_flash_bytes_written(struct stream_flash_ctx *ctx)
size_t stream_flash_bytes_written(const struct stream_flash_ctx *ctx)
{
return ctx->bytes_written;
}
@ -348,7 +348,7 @@ int stream_flash_progress_load(struct stream_flash_ctx *ctx,
return rc;
}
int stream_flash_progress_save(struct stream_flash_ctx *ctx,
int stream_flash_progress_save(const struct stream_flash_ctx *ctx,
const char *settings_key)
{
if (!ctx || !settings_key) {
@ -367,7 +367,7 @@ int stream_flash_progress_save(struct stream_flash_ctx *ctx,
return rc;
}
int stream_flash_progress_clear(struct stream_flash_ctx *ctx,
int stream_flash_progress_clear(const struct stream_flash_ctx *ctx,
const char *settings_key)
{
if (!ctx || !settings_key) {