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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user