Thread (14 messages) flat view 14 messages, 2 authors, 2021-03-08

RE: [PATCH net-next v2 6/6] net: qualcomm: rmnet: don't use C bit-fields in rmnet checksum header

From: David Laight <hidden>
Date: 2021-03-08 14:11:51
Also in: lkml

...
Sort of related, I have been meaning to eliminate the
pointless __aligned(1) tags on rmnet structures defined
in <linux/if_rmnet.h>.  It wouldn't hurt to use __packed,
though I think they're all 4 or 8 bytes naturally anyway.
Perhaps marking them __aligned(4) would help identify
potential unaligned accesses?
Don't use __packed (etc) unless the data might be misaligned.
If the architecture doesn't support misaligned memory
accesses then the compiler has to generate code that
does byte accesses and shifts.

__aligned(4) is mostly useful for structures that have
to have an 8-byte field on a 4-byte boundary.
(As happens in the x86 compat32 code.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help