• Gustavo A. R. Silva's avatar
    crypto: qat - Avoid -Wflex-array-member-not-at-end warnings · 140e4c85
    Gustavo A. R. Silva authored
    -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
    ready to enable it globally.
    
    Use the `__struct_group()` helper to separate the flexible array
    from the rest of the members in flexible `struct qat_alg_buf_list`,
    through tagged `struct qat_alg_buf_list_hdr`, and avoid embedding the
    flexible-array member in the middle of `struct qat_alg_fixed_buf_list`.
    
    Also, use `container_of()` whenever we need to retrieve a pointer to
    the flexible structure.
    
    So, with these changes, fix the following warnings:
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    drivers/crypto/intel/qat/qat_common/qat_bl.h:25:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
    
    Link: https://github.com/KSPP/linux/issues/202Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
    Acked-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    140e4c85
qat_bl.h 1.77 KB