Skip to contentSkip to conversation

USB: usb.h: tweak struct urb to remove wasted space

DISCUSSION Oliver Neukum 1 participant 1 message Mar 4, 2019 USB

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · Greg Kroah-Hartman
Quoted 9 lines · Oliver Neukum
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Oliver Neukum
Quoted 2 lines · Greg Kroah-Hartman

By moving one field around in 'struct urb' we reduce the size of the structure by 8 bytes.

If you are going for this I have to ask why unlink and status are full size ints anyway.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

History, they hold a "normal" negative error code. I guess we could turn them into s16, if it really matters, but that feels odd to me.

Returning internal error codes to user space is a bug.

Where does status and unlink end up going to userspace? Maybe through usbfs?

Nowhere, I hope. Sorry for the confusion. I hope I fixed that some time ago. My point here is that using the external errnos for internal error report is not an advantage. In fact, it is a bad idea. A byte would be ample to record internal errors.

Regards
Oliver