Re: drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value

From: Giovanni Cabiddu
Date: Wed Sep 01 2021 - 07:36:47 EST


On Wed, Sep 01, 2021 at 02:18:17PM +0300, Andy Shevchenko wrote:
> On Wed, Sep 01, 2021 at 12:19:08AM +0800, kernel test robot wrote:
> > >> drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value [-Waddress-of-packed-member]
> > adf_gen2_init_hw_csr_ops(&hw_data->csr_ops);
> > ^~~~~~~~~~~~~~~~
> > 3 warnings generated.
>
>
> Why on Earth the struct adf_hw_device_data, that contains a lot of pointers,
> marked as __packed?! That __packed has to be dropped.
That struct doesn't need to be marked as __packed.
I'm going to send a patch that drops that attribute for all the
structures that do not need to be packed in the QAT driver.

--
Giovanni