summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMacpaul Lin <macpaul.lin@mediatek.com>2020-06-18 17:13:38 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-24 10:57:00 +0100
commit8f0be8ad49cac42435dbbb663417b17e367d2989 (patch)
tree2868c1183ec72adbc2d7dc24c73d4776647e7b07 /include
parent69de3027142ce96c505f3c8c1491b085d210f950 (diff)
USB: replace hardcode maximum usb string length by definition
commit 81c7462883b0cc0a4eeef0687f80ad5b5baee5f6 upstream. Replace hardcoded maximum USB string length (126 bytes) by definition "USB_MAX_STRING_LEN". Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/1592471618-29428-1-git-send-email-macpaul.lin@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/usb/ch9.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
index ec6c8543732f..9ca4b43122d7 100644
--- a/include/uapi/linux/usb/ch9.h
+++ b/include/uapi/linux/usb/ch9.h
@@ -333,6 +333,9 @@ struct usb_config_descriptor {
/*-------------------------------------------------------------------------*/
+/* USB String descriptors can contain at most 126 characters. */
+#define USB_MAX_STRING_LEN 126
+
/* USB_DT_STRING: String descriptor */
struct usb_string_descriptor {
__u8 bLength;