Skip to content

Commit

Permalink
sd: omit zero-initialization for csd[4] and cid[4]
Browse files Browse the repository at this point in the history
After a review of the usage of csd[4] and cid[4],
it has been determined that zero-initialization can be omitted.

It can be expected from successful operations that data will be
appropriately written back from the underlying layer.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
  • Loading branch information
ndrs-pst authored and aescolar committed Jan 25, 2024
1 parent 8534c38 commit 1829fc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/sd/sd_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ static int sdmmc_read_cxd(struct sd_card *card, uint32_t opcode, uint32_t rca, u
int sdmmc_read_csd(struct sd_card *card)
{
int ret;
uint32_t csd[4] = {0};
uint32_t csd[4];
/* Keep CSD on stack for reduced RAM usage */
struct sd_csd card_csd = {0};

Expand All @@ -283,7 +283,7 @@ int sdmmc_read_csd(struct sd_card *card)
/* Reads card identification register, and decodes it */
int card_read_cid(struct sd_card *card)
{
uint32_t cid[4] = {0};
uint32_t cid[4];
int ret;
#if defined(CONFIG_SDMMC_STACK) || defined(CONFIG_SDIO_STACK)
/* Keep CID on stack for reduced RAM usage */
Expand Down

0 comments on commit 1829fc3

Please sign in to comment.