Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rong Zhang" <i@rong.moe>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2 9/9] HID: haptic: Remove stubs in favor of inlined dead code elimination
Date: Wed, 11 Nov 2026 00:45:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-208030@kernel.org> (raw)
In-Reply-To: <20261110-hid-haptic-kmod-v2-9-b835a067cb62@rong.moe>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] HID: haptic: hid_haptic_connected_to_input() returns ERR_PTR
  instead of false
--

commit 3914d83f5b9ce7ec32449543dd125ffa8f399224
Author: Rong Zhang <i@rong.moe>

HID: haptic: Remove stubs in favor of inlined dead code elimination

This commit removes the #else stub implementations in
drivers/hid/hid-haptic.h and replaces them with hid_haptic_enabled()
checks inside the inline helpers.

> diff --git a/drivers/hid/hid-haptic.h b/drivers/hid/hid-haptic.h
> index a71ccee569f31..070b56189ccbe 100644
> --- a/drivers/hid/hid-haptic.h
> +++ b/drivers/hid/hid-haptic.h

[ ... ]

> @@ -80,6 +87,9 @@ static inline struct hid_haptic_device *hid_haptic_alloc(struct hid_device *hdev
>  static inline bool hid_haptic_connected_to_input(struct hid_haptic_device *haptic,
>  						 struct input_dev *input)
>  {
> +	if (!hid_haptic_enabled())
> +		return ERR_PTR(-EOPNOTSUPP);
> +
>  	return haptic->input_dev == input;
>  }

[Severity: Medium]
Should hid_haptic_connected_to_input() return false instead of
ERR_PTR(-EOPNOTSUPP) when !hid_haptic_enabled()?  Because the return type
is bool, the non-NULL error pointer converts to true, inverting the return
value of the removed stub and preventing dead-code elimination in callers
such as mt_touch_input_configured().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110-hid-haptic-kmod-v2-0-b835a067cb62@rong.moe?part=9

  reply	other threads:[~2026-11-11  0:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 19:49 [PATCH v2 0/9] HID: Add hid-plugin framework & convert haptic into a plugin Rong Zhang
2026-11-09 19:49 ` [PATCH v2 1/9] HID: haptic: Fix use-after-free when draining workqueue Rong Zhang
2026-11-09 19:49 ` [PATCH v2 2/9] HID: haptic: Get rid of input_ff_destroy() in error paths Rong Zhang
2026-11-09 19:49 ` [PATCH v2 3/9] HID: haptic, multitouch: Check haptic prerequisite properly Rong Zhang
2026-11-09 19:49 ` [PATCH v2 4/9] HID: haptic, multitouch: Fix haptic device double-free and unnecessary allocation Rong Zhang
2026-11-11  0:06   ` sashiko-bot
2026-11-09 19:49 ` [PATCH v2 5/9] HID: haptic: Postpone GET_REPORT to init Rong Zhang
2026-11-09 19:49 ` [PATCH v2 6/9] HID: haptic: Convert simple methods into static inline ones Rong Zhang
2026-11-09 19:49 ` [PATCH v2 7/9] HID: Add hid-plugin framework for loadable plugin modules Rong Zhang
2026-11-11  0:25   ` sashiko-bot
2026-11-09 19:49 ` [PATCH v2 8/9] HID: haptic: Convert into a loadable plugin module Rong Zhang
2026-11-09 19:49 ` [PATCH v2 9/9] HID: haptic: Remove stubs in favor of inlined dead code elimination Rong Zhang
2026-11-11  0:45   ` sashiko-bot [this message]
2026-11-11 12:09     ` Rong Zhang

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=sashiko-outbox-208030@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=i@rong.moe \
    --cc=linux-input@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox