Thread (12 messages) 12 messages, 3 authors, 1d ago

Re: [PATCH v4] Input: gunze: replace deprecated APIs and fix warning style

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2026-07-20 01:24:25

On Sun, Jul 19, 2026 at 11:07:00PM +0530, Bivash Kumar Singh wrote:
Replace two uses of simple_strtoul() with kstrtoul() as the former
is deprecated. kstrtoul() requires a NUL-terminated string, so copy
the packet data into a local buffer and NUL-terminate the X and Y
fields before parsing. Initialize x and y to 0 so that if parsing
fails the coordinates fall back to 0 rather than reporting garbage,
and BTN_TOUCH is always updated regardless of parse result.
Please stop forcing use of kstrtoul() where it is not fit. If you want
to stop using simple_strtoul() then add '\0' when receive '\r' in
gunze_interrupt(), and use

	if (sscanf(gunze->data + 1, "%4u,%4u", &x, &y) != 2) {
		dev_warn_ratelimited(...);
		return;
	}

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help