4 ms·
The linux kernel USB API has a few functions that take a bunch of arguments. For example: int usb_control_msg(struct usb_device * dev, unsigned int pipe, __u8
by disconnected 9y ago
The linux kernel USB API has a few functions that take a bunch of arguments. For example:
int usb_control_msg(struct usb_device * dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void * data, __u16 size, int timeout);
So it is kind of hard to avoid going over the limit.
What we end up doing is break each argument into one line, like this (I hope the formatting comes out all right):
int res = usb_control_msg(
dev,
usb_sndctrlpipe(dev, 0),
0x41,
...
);
It's not so much of an eye-sore.
- quickben 9y agoAhhhh I see. Nortel had that coding guideline actually. Just in their case, the first argument followed the parenthesis. The second argument (and the rest) followed the first argument column.
- dllthomas 9y agoThat's a good approach, as can be the struct. An option not mentioned yet is to give things smaller local names.