sof: dcblock: Fix unaligned pointer value issue

gcc-9 shows the following issue:
error: taking address of packed member of ‘struct sof_abi_hdr’ may
result in an unaligned pointer value [-Werror=address-of-packed-member]
   225 |   request = (int32_t *)cdata->data->data;
       |                        ^~~~~

This commit fixes the issue. The warning was introduced in GCC-9, and
was therefore not raised by previous compiler versions.

Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
This commit is contained in:
Sebastiano Carlucci 2020-03-27 10:45:40 -07:00 committed by Tomasz Lauda
parent de0d11c876
commit 521895e3a0
1 changed files with 2 additions and 3 deletions

View File

@ -213,7 +213,6 @@ static int dcblock_cmd_set_data(struct comp_dev *dev,
struct sof_ipc_ctrl_data *cdata)
{
struct comp_data *cd = comp_get_drvdata(dev);
int32_t *request;
size_t req_size = sizeof(cd->R_coeffs);
int ret = 0;
@ -222,8 +221,8 @@ static int dcblock_cmd_set_data(struct comp_dev *dev,
comp_info(dev, "dcblock_cmd_set_data(), SOF_CTRL_CMD_BINARY");
/* Retrieve the binary controls from the packet */
request = (int32_t *)cdata->data->data;
ret = memcpy_s(cd->R_coeffs, req_size, request, req_size);
ret = memcpy_s(cd->R_coeffs, req_size, cdata->data->data,
req_size);
assert(!ret);
break;