Skip to contentSkip to conversation

usb: Fix typo in `struct usb_host_interface' comment

PATCH In review Chris Rorvick 2 participants 5 messages Jan 15, 2015 – Jan 16, 2015 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: Fix typo in `struct usb_host_interface' comment

The descriptor member `bNumEndpoints' is plural.

---
 include/linux/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/usb.h +1 -1
index f89c24a..4add566 100644
@@ -82,7 +82,7 @@ struct usb_host_interface {
 	int extralen;
 	unsigned char *extra;   /* Extra descriptors */
 
-	/* array of desc.bNumEndpoint endpoints associated with this
+	/* array of desc.bNumEndpoints endpoints associated with this
 	 * interface setting.  these will be in no particular order.
 	 */
 	struct usb_host_endpoint *endpoint;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 1 line · Chris Rorvick

The descriptor member `bNumEndpoints' is plural.

I am afraid that is not a good idea. The name of a member of a structure mentioned in the specification should appear as it is used in the specification.

Regards
Oliver

#2 lore raw
Quoted 6 lines · Oliver Neukum
Quoted 1 line · Chris Rorvick

The descriptor member `bNumEndpoints' is plural.

I am afraid that is not a good idea. The name of a member of a structure mentioned in the specification should appear as it is used in the specification.

Where is it not plural in the specification?

#3 lore raw
Quoted 9 lines · Chris Rorvick
Quoted 6 lines · Oliver Neukum
Quoted 1 line · Chris Rorvick

The descriptor member `bNumEndpoints' is plural.

I am afraid that is not a good idea. The name of a member of a structure mentioned in the specification should appear as it is used in the specification.

Where is it not plural in the specification?

I think understand your comment now so I will respond more specifically:
This is a typo precisely because bNumEndpoint' is not consistent with the specification, nor is it consistent with the definition of struct usb_interface_descriptor'. The specification and the structure both use `bNumEndpoints'.

Fixing this has utility because struct usb_interface_descriptor' is not defined in <linux/usb.h>. So, if corrected, the code for determining the number of endpoints is readily available to anyone looking at struct usb_host_interface' without tracking down the uapi header.

Mentioning that the descriptor member/field is plural was just an attempt to make it easy to see what changed.

Regards,

Chris

#4 lore raw
Quoted 7 lines · Chris Rorvick

I think understand your comment now so I will respond more specifically:
This is a typo precisely because bNumEndpoint' is not consistent with the specification, nor is it consistent with the definition of struct usb_interface_descriptor'. The specification and the structure both use
`bNumEndpoints'.

Sorry, I stand corrected. The patch is good.

Regards
Oliver