and similararchectures that can not handle unaligned accesses
and where pointer conversions cause compiler warnings when converting
a pointer to a larger type.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Some ISA, like ARMv6, do not support unaligned memory accesses.
The cast here technically convert a the pointer target from a char to
another pointer.
However, as the buf field (char) is laid out after a pointer in the
structure definition, the alignment for buf is forced to the same
alignment as a pointer.
Thus the issue with unaligned access can not happen and the workaround
by re-casting the pointer via void * is safe.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>