dfu: Fix build issue with gcc8

We get the following warning when buiding with gcc8:

	error: 'packed' attribute ignored for type 'u32_t *'
	{aka 'unsigned int *'} [-Werror=attributes]

Use UNALIGNED_GET() to access the data since we don't know the
alignment.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-01-30 16:18:49 -06:00 committed by Kumar Gala
commit 93d0f8c58d

View file

@ -42,7 +42,7 @@ static bool flash_verify(struct device *dev, off_t offset,
if (memcmp(data, &temp, size)) {
LOG_ERR("offset=0x%08"PRIx32" VERIFY FAIL. "
"expected: 0x%08x, actual: 0x%08x",
(u32_t)offset, temp, *(__packed u32_t*)data);
(u32_t)offset, temp, UNALIGNED_GET(data));
break;
}
len -= size;