Skip to content

Commit f2209d4

Browse files
jigpuJiri Kosina
authored and
Jiri Kosina
committed
HID: wacom: generic: Strip off excessive name prefixing
The product name received from the string descriptor in the new MobileStudio Pro line of tablets begins with "Wacom", which leads to unnecessary visual noise in the device name when appended to the vendor name which also includes "Wacom". Look for and fix cases like this. Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 6005a13 commit f2209d4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/hid/wacom_sys.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,6 +1940,19 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix)
19401940
/* shift everything including the terminator */
19411941
memmove(gap, gap+1, strlen(gap));
19421942
}
1943+
1944+
/* strip off excessive prefixing */
1945+
if (strstr(name, "Wacom Co.,Ltd. Wacom ") == name) {
1946+
int n = strlen(name);
1947+
int x = strlen("Wacom Co.,Ltd. ");
1948+
memmove(name, name+x, n-x+1);
1949+
}
1950+
if (strstr(name, "Wacom Co., Ltd. Wacom ") == name) {
1951+
int n = strlen(name);
1952+
int x = strlen("Wacom Co., Ltd. ");
1953+
memmove(name, name+x, n-x+1);
1954+
}
1955+
19431956
/* get rid of trailing whitespace */
19441957
if (name[strlen(name)-1] == ' ')
19451958
name[strlen(name)-1] = '\0';

0 commit comments

Comments
 (0)