iser: Fix a compiler warning triggered by the container_of() definition

This patch fixes the following compiler warning:

iser.c:338:14: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct iser_pdu *' increases required alignment from 1 to 8 [-Werror,-Wcast-align]
                iser_pdu = container_of(pdu, struct iser_pdu, iscsi_pdu);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Bart Van Assche
2021-08-26 11:47:07 -07:00
parent 5cbbc95c20
commit aa214feaf3

View File

@@ -46,7 +46,7 @@
*
*/
#define container_of(ptr, type, member) \
((type *) ((uint8_t *)(ptr) - offsetof(type, member)))
((type *)(void *)((uint8_t *)(ptr) - offsetof(type, member)))
#endif