]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: intel-ish-ipc: Remove redundant ready check after timeout function
authorZhang Lixu <lixu.zhang@intel.com>
Thu, 21 Aug 2025 02:06:09 +0000 (10:06 +0800)
committerJiri Kosina <jkosina@suse.com>
Fri, 12 Sep 2025 15:22:41 +0000 (17:22 +0200)
commit8931f7b27993444adfc8cd1d3c6592cc167fb280
tree8a8d9b0e1c1b36cd06a0a438d7f49fc0ee723a31
parent02d6eeedbc36d4b309d5518778071a749ef79c4e
HID: intel-ish-ipc: Remove redundant ready check after timeout function

timed_wait_for_timeout() internally checks for ish_is_input_ready() and
ishtp_fw_is_ready() based on the provided parameters. If
timed_wait_for_timeout() returns 0, it indicates the status is ready. In
rare cases, another thread may send a message immediately after
timed_wait_for_timeout() returns, causing a subsequent ish_is_input_ready()
check to fail. Since the return value of timed_wait_for_timeout() is
sufficient to determine readiness, the additional ready check is
unnecessary and may introduce issues.

This patch removes the redundant check and relies solely on the return
value of timed_wait_for_timeout().

Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/intel-ish-hid/ipc/ipc.c