diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-04-11 13:54:57 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-04-11 15:14:43 +0200 |
commit | 4f2e373ffe6ff5931fd60d229d3807768374d59f (patch) | |
tree | 92ce158b180922c1573f1cd2d1362217aadf256f /libmachdev/dev_hdr.h | |
parent | c1685eb975f84c5df38f20eb4698ede36a1653e1 (diff) |
libmachdev: avoid doing pointer arithmetic to get the port_info
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 making mach_convert_port_to_device return
a pointer to struct mach_device instead.
* libmachdev/ds_routines.c (mach_convert_port_to_device): Return
struct mach_dev *.
(device_to_pi): Remove now unused function.
(ds_device_close): Adjust accordingly.
(ds_device_write): Likewise.
(ds_device_write_inband): Likewise.
(ds_device_read): Likewise.
(ds_device_read_inband): Likewise.
(ds_device_set_status): Likewise.
(ds_device_get_status): Likewise.
(ds_device_set_filter): Likewise.
Diffstat (limited to 'libmachdev/dev_hdr.h')
0 files changed, 0 insertions, 0 deletions