linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] HID: fix test for CONFIG_HID_KUNIT_TEST=m
@ 2024-12-08 12:01 Thomas Weißschuh
  2024-12-08 12:01 ` [PATCH 1/2] HID: input: " Thomas Weißschuh
  2024-12-08 12:01 ` [PATCH 2/2] HID: uclogic: " Thomas Weißschuh
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2024-12-08 12:01 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, José Expósito
  Cc: linux-input, linux-kernel, Thomas Weißschuh

If CONFIG_HID_KUNIT_TEST is set to "m", the #ifdef test does not work.
Switch to IS_ENABLED() which works for both "m" and "y".

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (2):
      HID: input: fix test for CONFIG_HID_KUNIT_TEST=m
      HID: uclogic: fix test for CONFIG_HID_KUNIT_TEST=m

 drivers/hid/hid-input.c          | 2 +-
 drivers/hid/hid-uclogic-core.c   | 2 +-
 drivers/hid/hid-uclogic-params.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 7503345ac5f5e82fd9a36d6e6b447c016376403a
change-id: 20241208-hid-ifdef-kunit-75643b52239a

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] HID: input: fix test for CONFIG_HID_KUNIT_TEST=m
  2024-12-08 12:01 [PATCH 0/2] HID: fix test for CONFIG_HID_KUNIT_TEST=m Thomas Weißschuh
@ 2024-12-08 12:01 ` Thomas Weißschuh
  2024-12-09  5:08   ` kernel test robot
  2024-12-08 12:01 ` [PATCH 2/2] HID: uclogic: " Thomas Weißschuh
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Weißschuh @ 2024-12-08 12:01 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, José Expósito
  Cc: linux-input, linux-kernel, Thomas Weißschuh

If CONFIG_HID_KUNIT_TEST is set to "m", the #ifdef test does not work.
Switch to IS_ENABLED() which works for both "m" and "y".

Fixes: a608dc1c0639 ("HID: input: map battery system charging")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/hid-input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index fda9dce3da99808e04ce66dd7beec6731173e75f..8f065d89979c3577dcc17a6f0d52468d69f16c87 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -2388,6 +2388,6 @@ void hidinput_disconnect(struct hid_device *hid)
 }
 EXPORT_SYMBOL_GPL(hidinput_disconnect);
 
-#ifdef CONFIG_HID_KUNIT_TEST
+#if IS_ENABLED(CONFIG_HID_KUNIT_TEST)
 #include "hid-input-test.c"
 #endif

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] HID: uclogic: fix test for CONFIG_HID_KUNIT_TEST=m
  2024-12-08 12:01 [PATCH 0/2] HID: fix test for CONFIG_HID_KUNIT_TEST=m Thomas Weißschuh
  2024-12-08 12:01 ` [PATCH 1/2] HID: input: " Thomas Weißschuh
@ 2024-12-08 12:01 ` Thomas Weißschuh
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2024-12-08 12:01 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, José Expósito
  Cc: linux-input, linux-kernel, Thomas Weißschuh

If CONFIG_HID_KUNIT_TEST is set to "m", the #ifdef test does not work.
Switch to IS_ENABLED() which works for both "m" and "y".

Fixes: a251d6576d2a ("HID: uclogic: Handle wireless device reconnection")
Fixes: a64cbf3ce631 ("HID: uclogic: Refactor UGEE v2 string descriptor parsing")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/hid-uclogic-core.c   | 2 +-
 drivers/hid/hid-uclogic-params.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index d8008933c052f5c9b5df9dadc5bce353f3c5b948..a824df67add9eb1d3dd7776fefd8f6f079bf509b 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -571,6 +571,6 @@ MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID standard");
 
-#ifdef CONFIG_HID_KUNIT_TEST
+#if IS_ENABLED(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-params.c
index ef26c7defcf61ced86b07100002e572780f23305..b5d4bb77c83c7e1ab3051d3b619993bc1b08204d 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -1860,6 +1860,6 @@ int uclogic_params_init(struct uclogic_params *params,
 	return rc;
 }
 
-#ifdef CONFIG_HID_KUNIT_TEST
+#if IS_ENABLED(CONFIG_HID_KUNIT_TEST)
 #include "hid-uclogic-params-test.c"
 #endif

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] HID: input: fix test for CONFIG_HID_KUNIT_TEST=m
  2024-12-08 12:01 ` [PATCH 1/2] HID: input: " Thomas Weißschuh
@ 2024-12-09  5:08   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-12-09  5:08 UTC (permalink / raw)
  To: Thomas Weißschuh, Jiri Kosina, Benjamin Tissoires,
	José Expósito
  Cc: llvm, oe-kbuild-all, linux-input, linux-kernel,
	Thomas Weißschuh

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on 7503345ac5f5e82fd9a36d6e6b447c016376403a]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/HID-input-fix-test-for-CONFIG_HID_KUNIT_TEST-m/20241208-200350
base:   7503345ac5f5e82fd9a36d6e6b447c016376403a
patch link:    https://lore.kernel.org/r/20241208-hid-ifdef-kunit-v1-1-cbea6077a233%40weissschuh.net
patch subject: [PATCH 1/2] HID: input: fix test for CONFIG_HID_KUNIT_TEST=m
config: i386-randconfig-012-20241209 (https://download.01.org/0day-ci/archive/20241209/202412091018.qz83ukPy-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241209/202412091018.qz83ukPy-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412091018.qz83ukPy-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: kunit_kmalloc_array
   >>> referenced by test.h:447 (include/kunit/test.h:447)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by test.h:447 (include/kunit/test.h:447)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a
   >>> referenced by test.h:447 (include/kunit/test.h:447)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: kunit_binary_assert_format
   >>> referenced by hid-input-test.c:20 (drivers/hid/hid-input-test.c:20)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:24 (drivers/hid/hid-input-test.c:24)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:28 (drivers/hid/hid-input-test.c:28)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced 6 more times
--
>> ld.lld: error: undefined symbol: __kunit_do_failed_assertion
   >>> referenced by hid-input-test.c:20 (drivers/hid/hid-input-test.c:20)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:24 (drivers/hid/hid-input-test.c:24)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:28 (drivers/hid/hid-input-test.c:28)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced 9 more times
--
>> ld.lld: error: undefined symbol: kunit_ptr_not_err_assert_format
   >>> referenced by hid-input-test.c:16 (drivers/hid/hid-input-test.c:16)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:39 (drivers/hid/hid-input-test.c:39)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a
   >>> referenced by hid-input-test.c:43 (drivers/hid/hid-input-test.c:43)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: __kunit_abort
   >>> referenced by hid-input-test.c:16 (drivers/hid/hid-input-test.c:16)
   >>>               drivers/hid/hid-input.o:(hid_test_input_set_battery_charge_status) in archive vmlinux.a
   >>> referenced by hid-input-test.c:39 (drivers/hid/hid-input-test.c:39)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a
   >>> referenced by hid-input-test.c:43 (drivers/hid/hid-input-test.c:43)
   >>>               drivers/hid/hid-input.o:(hid_test_input_get_battery_property) in archive vmlinux.a

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-09  5:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-08 12:01 [PATCH 0/2] HID: fix test for CONFIG_HID_KUNIT_TEST=m Thomas Weißschuh
2024-12-08 12:01 ` [PATCH 1/2] HID: input: " Thomas Weißschuh
2024-12-09  5:08   ` kernel test robot
2024-12-08 12:01 ` [PATCH 2/2] HID: uclogic: " Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).