linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can.h: make padding given by gcc explicit
@ 2015-05-01 19:54 Shawn Landden
  2015-05-01 20:23 ` Marc Kleine-Budde
  2015-05-04 16:00 ` Oliver Hartkopp
  0 siblings, 2 replies; 8+ messages in thread
From: Shawn Landden @ 2015-05-01 19:54 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde, Shawn Landden

The current definition of struct can_frame has a 16-byte size, with 8-byte
alignment, but the 3 bytes of padding are not explicit like the similar 2 bytes
of padding of struct canfd_frame. Make it explicit so it is easier to read.

Signed-off-by: Shawn Landden <shawn@churchofgit.com>
---
 include/uapi/linux/can.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h
index 41892f7..bc1b937 100644
--- a/include/uapi/linux/can.h
+++ b/include/uapi/linux/can.h
@@ -100,6 +100,7 @@ typedef __u32 can_err_mask_t;
 struct can_frame {
 	canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
 	__u8    can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
+        __u8    __res[3];/* reserved / padding */
 	__u8    data[CAN_MAX_DLEN] __attribute__((aligned(8)));
 };
 
-- 
2.2.1.209.g41e5f3a


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-05 19:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-01 19:54 [PATCH] can.h: make padding given by gcc explicit Shawn Landden
2015-05-01 20:23 ` Marc Kleine-Budde
2015-05-04 16:00 ` Oliver Hartkopp
2015-05-05  7:03   ` Shawn Landden
2015-05-05  7:06     ` Marc Kleine-Budde
2015-05-05 16:07   ` Shawn Landden
2015-05-05 19:02     ` Oliver Hartkopp
2015-05-05 19:25     ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).