mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
can: introduce CAN_REQUIRED_SIZE macro
The size of this structure will be increased with J1939 support. To stay binary compatible, the CAN_REQUIRED_SIZE macro is introduced for existing CAN protocols. Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
4f746fb495
commit
9868b5d44f
3 changed files with 12 additions and 4 deletions
|
@ -41,6 +41,14 @@ struct can_proto {
|
|||
struct proto *prot;
|
||||
};
|
||||
|
||||
/* required_size
|
||||
* macro to find the minimum size of a struct
|
||||
* that includes a requested member
|
||||
*/
|
||||
#define CAN_REQUIRED_SIZE(struct_type, member) \
|
||||
(offsetof(typeof(struct_type), member) + \
|
||||
sizeof(((typeof(struct_type) *)(NULL))->member))
|
||||
|
||||
/* function prototypes for the CAN networklayer core (af_can.c) */
|
||||
|
||||
extern int can_proto_register(const struct can_proto *cp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue