Skip to content

Commit

Permalink
drivers: flash: sam0: fix unaligned memory read
Browse files Browse the repository at this point in the history
Use the UNALIGNED_GET() macro instead of the
flash_sam0_read_unaigned_u32() function to ensure
word alignment of the source address.

Signed-off-by: Steven Slupsky <sslupsky@gmail.com>

drivers: flash: sam0:  fix whitespace

Fix checkpass whitespace error.

Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
  • Loading branch information
sslupsky authored and avisconti committed Apr 15, 2020
1 parent d83c623 commit a3e7a13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/flash/flash_sam0.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int flash_sam0_write_page(struct device *dev, off_t offset,

/* Ensure writes happen 32 bits at a time. */
for (; src != end; src++, dst++) {
*dst = *src;
*dst = UNALIGNED_GET((u32_t *)src);
}

#ifdef NVMCTRL_CTRLA_CMD_WP
Expand Down

0 comments on commit a3e7a13

Please sign in to comment.