On 10.10.2022 20:52:36, Jimmy Assarsson wrote: > Add struct kvaser_usb_busparams containing the busparameters used in > CMD_{SET,GET}_BUSPARAMS* commands. > > Tested-by: Anssi Hannula <anssi.hannula@xxxxxxxxxx> > Signed-off-by: Jimmy Assarsson <extja@xxxxxxxxxx> > --- [...] > +struct kvaser_usb_busparams { > + __le32 bitrate; > + u8 tseg1; > + u8 tseg2; > + u8 sjw; > + u8 nsamples; > +}; | drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c:169:30: error: field | busparams within 'struct kvaser_cmd_busparams' is less aligned than | 'struct kvaser_usb_busparams' and is usually due to 'struct | kvaser_cmd_busparams' being packed, which can lead to unaligned | accesses [-Werror,-Wunaligned-access] | struct kvaser_usb_busparams busparams; | ^ Fixed (again) while applying. diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb.h b/drivers/net/can/usb/kvaser_usb/kvaser_usb.h index 8c4c2f00fb9f..ff10b3790d84 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb.h +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb.h @@ -82,7 +82,7 @@ struct kvaser_usb_busparams { u8 tseg2; u8 sjw; u8 nsamples; -}; +} __packed; struct kvaser_usb { struct usb_device *udev; regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature