All of
 help / color / mirror / Atom feed
From: Jiri Kosina <>
To: "Gerecke, Jason" <>
	Benjamin Tissoires <>,
	Ping Cheng <>,
	Aaron Armstrong Skomra <>,, Jason Gerecke <>,
	Aaron Armstrong Skomra <>
Subject: Re: [PATCH] HID: wacom: generic: Treat serial number and related fields as unsigned
Date: Wed, 6 Nov 2019 21:38:43 +0100 (CET)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, 6 Nov 2019, Gerecke, Jason wrote:

> From: Jason Gerecke <>
> The HID descriptors for most Wacom devices oddly declare the serial
> number and other related fields as signed integers. When these numbers
> are ingested by the HID subsystem, they are automatically sign-extended
> into 32-bit integers. We treat the fields as unsigned elsewhere in the
> kernel and userspace, however, so this sign-extension causes problems.
> In particular, the sign-extended tool ID sent to userspace as ABS_MISC
> does not properly match unsigned IDs used by xf86-input-wacom and libwacom.
> We introduce a function 'wacom_s32tou' that can undo the automatic sign
> extension performed by 'hid_snto32'. We call this function when processing
> the serial number and related fields to ensure that we are dealing with
> and reporting the unsigned form. We opt to use this method rather than
> adding a descriptor fixup in 'wacom_hid_usage_quirk' since it should be
> more robust in the face of future devices.
> Ref:
> Fixes: f85c9dc678 ("HID: wacom: generic: Support tool ID and additional tool types")
> CC: <> # v4.10+
> Signed-off-by: Jason Gerecke <>
> Reviewed-by: Aaron Armstrong Skomra <>

Applied to for-5.4/upstream-fixes.

Jiri Kosina

      reply	other threads:[~2019-11-06 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 19:59 [PATCH] HID: wacom: generic: Treat serial number and related fields as unsigned Gerecke, Jason
2019-11-06 20:38 ` Jiri Kosina [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.