diff options
author | Jiri Kosina <jkosina@suse.cz> | 2021-11-05 14:11:10 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2021-11-05 14:11:10 +0300 |
commit | b026277a8403fe72acb4b52b9bebe716499c064c (patch) | |
tree | 1f2f45ab4591fe5fb7996e03c821fbe44c24764a /drivers/hid/hid-debug.c | |
parent | 820e9906cf64142169134f35b996108303cf22ca (diff) | |
parent | 8e3cd9221c66b97c31964c013499e6c8d0f49440 (diff) | |
download | linux-b026277a8403fe72acb4b52b9bebe716499c064c.tar.xz |
Merge branch 'for-5.16/core' into for-linus
- update to handle TransducerSerialNumber2 which has been recently
added to the specification (Felipe Balbi)
Diffstat (limited to 'drivers/hid/hid-debug.c')
-rw-r--r-- | drivers/hid/hid-debug.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index fa57d05badf7..7a92e2a04a09 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -160,6 +160,7 @@ static const struct hid_usage_entry hid_usage_table[] = { {0, 0x59, "ButtonType"}, {0, 0x5A, "SecondaryBarrelSwitch"}, {0, 0x5B, "TransducerSerialNumber"}, + {0, 0x6e, "TransducerSerialNumber2"}, { 15, 0, "PhysicalInterfaceDevice" }, {0, 0x00, "Undefined"}, {0, 0x01, "Physical_Interface_Device"}, @@ -486,8 +487,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { if (!f) { len = strlen(buf); - snprintf(buf+len, max(0, HID_DEBUG_BUFSIZE - len), "."); - len++; + len += scnprintf(buf + len, HID_DEBUG_BUFSIZE - len, "."); } else { seq_printf(f, "."); @@ -498,7 +498,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { if (p->usage == (usage & 0xffff)) { if (!f) snprintf(buf + len, - max(0,HID_DEBUG_BUFSIZE - len - 1), + HID_DEBUG_BUFSIZE - len, "%s", p->description); else seq_printf(f, @@ -509,8 +509,8 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { break; } if (!f) - snprintf(buf + len, max(0, HID_DEBUG_BUFSIZE - len - 1), - "%04x", usage & 0xffff); + snprintf(buf + len, HID_DEBUG_BUFSIZE - len, "%04x", + usage & 0xffff); else seq_printf(f, "%04x", usage & 0xffff); return buf; |