]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
can: gs_usb: use union and FLEX_ARRAY for data in struct gs_host_frame
authorPeter Fink <pfink@christ-es.de>
Tue, 7 Dec 2021 18:22:50 +0000 (19:22 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 10 Mar 2022 08:49:15 +0000 (09:49 +0100)
commitc359931d2545173c4328d828643035259a0ba936
tree4de2fd994e3f213f6f99aa732142f388945aef17
parente10ab8b394053cedd1329ce1aeb4bb1fda8067f8
can: gs_usb: use union and FLEX_ARRAY for data in struct gs_host_frame

Modify struct gs_host_frame to make use of a union and
DECLARE_FLEX_ARRAY to be able to store different data (lengths), which
will be added in later commits.

Store the gs_host_frame length in TX direction (host -> device) in
struct gs_can::hf_size_tx and RX direction (device -> host) in struct
gs_usb::hf_size_rx so it must be calculated only once.

Link: https://lore.kernel.org/all/20220309124132.291861-15-mkl@pengutronix.de
Signed-off-by: Peter Fink <pfink@christ-es.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/gs_usb.c