Re: [PATCH 3/6] libmachdev: avoid doing pointer arithmetic to get the port_info

2014-04-12 Thread Samuel Thibault
Justus Winter, le Fri 11 Apr 2014 15:34:11 +0200, a écrit : > Previously, mach_convert_port_to_device would return a pointer to > struct emul_device, which is embedded in struct mach_device. In order > to get to the port_info structure which is right before that, > device_to_pi would subtract offs

[PATCH 3/6] libmachdev: avoid doing pointer arithmetic to get the port_info

2014-04-11 Thread Justus Winter
Previously, mach_convert_port_to_device would return a pointer to struct emul_device, which is embedded in struct mach_device. In order to get to the port_info structure which is right before that, device_to_pi would subtract offsetof (struct mach_device, dev) from the pointer. Avoid that by maki