From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796351485; b=NWqzQejQTNldxmCo0KCkXk1Bbm7AFejAdcpUZUNrAjghpUgKvJmROWeFNmqg6SRUoH7G im3iVUOVrT9s4tI9g/sJ7j177Jkg0Of404HepQ28k/mYRU6RU2Xacbw6OsRLeT9MjXK3y aPSjCtqGn0uONtfLZPVbgk+06olNx/2wEEZo52UzHhosVbeZc/YF8sIkZqnvvhqy1XgJs mvo2Rped6lYmgplfD5+q4PXb/L9i0npzpcjtSO0MsVI3zxvXV935UeWxpPpzRKG/xsaPV YmfkRrENZTyUxzBEmelR1Lv0CbxghQ4lknWIgCn16Flcsvmc/b+suO/olqrc6RKb92Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796351485; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=HWlSnBzAe2ZTEy7MGDe3TcVldNdLGYwjXnZ1QhYUK1g=; b=uiXWLVQxfyQzJBtDKs+wrxXRaD9JLANvu1HkcjIkoujWSMKuJHOhTk0FKCzbY4HxGrts FDrKagLugDAEUcPRqF2RlMCTmsPjmTjdB5avvsBASwAPTzkRcU8uNlTMd80upR/xtzoYR G49d/DCaQY91bWlSeFPxZRkikov6ZJ6Ixc7rCm6oZrGFk5OY+awsjQPnXrtjgupY6qI8R gLYdaq5fZyLBkOkcnCVkwGnaHuSfaT8GcMwFY+QzdrqDw4TY6g4MrUstaPJqaJml1jsmq oMo6DVq0AILO/07QrNL2p/XjeN/4rNCwIjZcMMizL4pSaGy8a5qVK83dyU4AgQkcBFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=btuC3bhS; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B43C1606A322 for ; Fri, 4 Dec 2026 02:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=btuC3bhS Received: by smtp.kernel.org (Postfix) with ESMTPSA id 308B61F000CE; Fri, 4 Dec 2026 02:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796351485; bh=HWlSnBzAe2ZTEy7MGDe3TcVldNdLGYwjXnZ1QhYUK1g=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=btuC3bhSbHPQ5rqAT0Saift/0yQ5iKuXskiBjZufvkmURyTtc8yVZBTIGUm3UeXjt 5HlSATwuHrZaz1gcoZ7usfvciosW8/jXvTXBkMdY77c1k7yfnRB7BX4M7lt9TCyzo+ tIB0b8AxQJS/yr9Feg+95k6SD4Pcp+ggoJPcNJz+q6W7ovPOa85ieAxaEJh/UdaFkW DU0LcLPZngiKixG8SrY8MVxcutI5sg9HKsV97miFUUWI4xg+J7OCsmXd/+C+H75Wae sJvp9LLoWr3UrnTR17GrV3Trj+Bur4MWtGQtmANC7jB5GmgfUB/MgMmmfo2ApBlCzU eHwirEi/x+UjQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] HID: use IS_REACHABLE(CONFIG_HID_KUNIT_TEST) for inlined KUnit tests Reply-To: sashiko-reviews@lists.linux.dev To: "Pengpeng Hou" Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com In-Reply-To: <179634995880.74470.16564934617135542670@163.com> References: <179634995880.74470.16564934617135542670@163.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 02:31:24 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] HID: IS_REACHABLE() embeds KUnit tests and MODULE_* tags in hid/uclogic -- commit 56471648f10e8fd31480b4cebd55002c586cb470 Author: Pengpeng Hou HID: use IS_REACHABLE(CONFIG_HID_KUNIT_TEST) for inlined KUnit tests This patch replaces #ifdef CONFIG_HID_KUNIT_TEST with IS_REACHABLE(CONFIG_HID_KUNIT_TEST) in hid-input.c, hid-uclogic-core.c, and hid-uclogic-params.c so the included KUnit test files are compiled when both the drivers and CONFIG_HID_KUNIT_TEST are built as modules. > diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c > index a4d3536c7af29..c97490fa3f8c9 100644 > --- a/drivers/hid/hid-input.c > +++ b/drivers/hid/hid-input.c > @@ -2478,6 +2478,6 @@ void hidinput_reset_resume(struct hid_device *hid) > } > EXPORT_SYMBOL_GPL(hidinput_reset_resume); > =20 > -#ifdef CONFIG_HID_KUNIT_TEST > +#if IS_REACHABLE(CONFIG_HID_KUNIT_TEST) > #include "hid-input-test.c" > #endif > diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-cor= e.c > index eea4238b94213..821cc4a72d848 100644 > --- a/drivers/hid/hid-uclogic-core.c > +++ b/drivers/hid/hid-uclogic-core.c > @@ -657,6 +657,6 @@ MODULE_DESCRIPTION("HID driver for UC-Logic devices n= ot fully compliant with HID > MODULE_LICENSE("GPL"); > MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant = with HID standard"); > =20 > -#ifdef CONFIG_HID_KUNIT_TEST > +#if IS_REACHABLE(CONFIG_HID_KUNIT_TEST) > #include "hid-uclogic-core-test.c" > #endif > diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-p= arams.c > index ed16f50f21edc..8c5617bca7a17 100644 > --- a/drivers/hid/hid-uclogic-params.c > +++ b/drivers/hid/hid-uclogic-params.c > @@ -2019,6 +2019,6 @@ int uclogic_params_init(struct uclogic_params *para= ms, > return rc; > } > =20 > -#ifdef CONFIG_HID_KUNIT_TEST > +#if IS_REACHABLE(CONFIG_HID_KUNIT_TEST) > #include "hid-uclogic-params-test.c" > #endif [Severity: Medium] Should these KUnit test files be embedded directly into hid.ko and hid-uclogic.ko via IS_REACHABLE()? In modular builds such as allmodconfig or CONFIG_KUNIT_ALL_TESTS=3Dm, this gives core hid.ko and hid-uclogic.ko a hard runtime dependency on kunit.ko. kunit_module_notify() then runs the embedded suites whenever hid.ko or hid-uclogic.ko loads, and the tests cannot be run or unloaded independently. All three included test files also contain standalone MODULE_DESCRIPTION(), MODULE_LICENSE(), and MODULE_AUTHOR() macros, which end up in hid.ko and hid-uclogic.ko modinfo alongside the drivers' own metadata. Meanwhile, with the default CONFIG_HID=3Dy and CONFIG_HID_KUNIT_TEST=3Dm, IS_REACHABLE(CONFIG_HID_KUNIT_TEST) still evaluates to 0 and omits all three suites. Instead of embedding tests in host modules, expose the static helpers with VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT and build separate modules, as in Documentation/dev-tools/kunit/usage.rst and f4ceb2a044f6 ("HID: uclogic: Avoid linking common code into multiple modules"). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/179634995880.74470.= 16564934617135542670@163.com?part=3D1