On 31.01.2022 14:25:28, Stéphane Grosjean wrote: > >> + u32 devid; > >> > >> + memcpy(data, (u8 *)&devid + eeprom->offset, eeprom->len); > > > > cast not needed. > > > > We need to cast the u32 * into a u8 * because eeprom->offset is a count of bytes, isn't it? Doh! right. What about endianness? I think it's better to use an array of bytes everywhere. 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